The following app hangs when launched on MacOS X with jdk8u40 as a jnlp app (netbeans project is attached):
package cft;
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class CFT {
private static void initAndShowGUI() {
JFrame frame = new JFrame("FX");
frame.setSize(100, 100);
final JFXPanel fxPanel = new JFXPanel();
frame.add(fxPanel);
frame.setVisible(true);
Platform.runLater(new Runnable() {
@Override
public void run() {
initFX(fxPanel);
}
});
}
private static void initFX(JFXPanel fxPanel) {
Scene scene = createScene();
fxPanel.setScene(scene);
}
private static Scene createScene() {
StackPane p = new StackPane();
Scene scene = new Scene(p);
p.getChildren().add(new Button("fx button"));
return scene;
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
initAndShowGUI();
}
});
}
}