I basically want to be able to launch a new Javafx window (stage) after (and inside) my LWJGL/GLFW thread starts. I am basically doing:
Thread thread = new Thread(()->Platform.runLater(()->{
Stage stage = new Stage();
//Stage setup
stage.show();
}));
thread.start();
thread being my game thread.
But it never runs and I've tried a System.out.println()
inside Platform.runLater()
just to check it never runs.
Why does it never run and what can I do to fix it? Thanks.
EDIT: Just to clarify that the thread has definitely started and whatnot, if I do:
Thread thread = new Thread(()->{
System.out.println("Before Platform.runLater()");
Platform.runLater(()->System.out.println("Inside Platform.runLater()"));
System.out.println("After Platform.runLater()");
});
It outputs:
Before Platform.runLater()
After Platform.runLater()