I want to integrate openjfx into my Java 11 code. Using IntelliJ IDEA 2018.2.6 on Windows 10, I created a test project and tried out below code
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import javafx.scene.control.TabPane;
public class Java11FXTestApplication {
public static void main(String[] args) {
JFXPanel dummyPanel;
TabPane dummyTabPane;
Scene dummyScene;
System.out.println("Creating JFX Panel");
dummyPanel = new JFXPanel();
System.out.println("Creating TabPane");
dummyTabPane = new TabPane();
System.out.println("Creating Scene");
dummyScene = new Scene(dummyTabPane);
System.out.println("Setting Scene");
dummyPanel.setScene(dummyScene); //Freezing here
System.out.println("Scene Created");
}
}
this code is freezing in setScene() method call. I tried debugging it and found that it the code wait indefinitely in secondaryLoop.enter() call in JFXPanel.setScene method. any Idea why?
This code works fine in JDK-8 but not working with java-11.0.1.
I am getting nowhere with this issue, kind of stuck at the Java11 JavaFX problem. Is there something wrong with the code? or any reported issue with javafx for java11