First of all: no, I am not trying to embed JavaFX panel inside a JPanel.
I have an application in JavaFX but I need to use a JFrame.
As far as I understand, they can coexist, but I am getting an error (Assertion Failure).
I am getting:
Arrows shows:
- JFrame opens
- Java version == 1.7.0_71
- Error
The code to reproduce is:
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame f = new JFrame("Test");
f.setVisible(true);
}});
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("TEST");
App.launch(args);
}
If I remove the Thread.sleep(), I get no error, but my JavaFX App does not start. If I keep the Thread.sleep(), I get the error. If I remove the invokeLater(), I get a HeadlessException
I cannot move to Java 8.
I would appreciate any help