I know this topic is old but I'll leave my answer here because I might come back here sometime if you want to disable the JavaFX window and later call it again with Platform.runLater
you must set this line at the beginning of your program
platform.setImplicitExit(false);
this will cause the JavaFX
thread to not exit after closing the last window and Platform.runLater will not be skipped when invoking
But if you want to call the window again it is necessary to put it in Platform.runLater
a new Stage was created
platform.runLater(() -> {
Stage newStage = new Stage();
loginMaster = new LoginMaster(newStage, mySqlJdbcTemplate, master);
loginMaster.showLoginScene();
});