How to get stage from controller during initialization?

You can get the instance of the controller from the FXMLLoader after initialization via getController(), but you need to instantiate an FXMLLoader instead of using the static methods then. I’d pass the stage after calling load() directly to the controller afterwards: FXMLLoader loader = new FXMLLoader(getClass().getResource(“MyGui.fxml”)); Parent root = (Parent)loader.load(); MyController controller = (MyController)loader.getController(); controller.setStageAndSetupListeners(stage); … Read more

Is it possible to run JavaFX applications on iOS, Android or Windows Phone 8?

Yes you can run JavaFX application on iOS, android, desktop, RaspberryPI (no windows8 mobile yet). Work in Action : We did it! JavaFX8 multimedia project on iPad, Android, Windows and Mac! JavaFX Everywhere Ensemble8 Javafx8 Android Demo My Sample JavaFX application Running on Raspberry Pi My Sample Application Running on Android JavaFX on iOS and … Read more

JavaFX and OpenJDK

JavaFX is part of OpenJDK The JavaFX project itself is open source and is part of the OpenJDK project. However, the OpenJDK project includes many projects, including incubating projects and other projects, such as OpenJFX, whose source and implementation are not shipped as part of some JDK/JRE distributions (e.g. Oracle JDK 11+ implementations and many … Read more

JavaFX Application Icon

Assuming your stage is “stage” and the file is on the filesystem: stage.getIcons().add(new Image(“file:icon.png”)); As per the comment below, if it’s wrapped in a containing jar you’ll need to use the following approach instead: stage.getIcons().add(new Image(<yourclassname>.class.getResourceAsStream(“icon.png”)));