I am developing one JavaFX application. GUI is in .fxml file. Trying to load .fxml file in BlueJ IDE, but not able to load. But The same code working properly in Eclipse IDE. When I load Non-BlueJ JavaFX project (which is Eclipse project), it loads all .java and .css files, but not .fxml file. I written in Eclipse IDE, But I have to run it in BlueJ IDE. what to do now? can I convert this .fxml into .java code? if yes, how? or is there any other way?
.fxml files will not be shown in BlueJ IDE, but can be loaded at Run time by specifying the path. To load .fxml file in BlueJ, you have to add src at beginning of path of the .fxml file.
In Main.java
Parent root=FXMLLoader.load(getClass().getClassLoader().getResource("src/application/FutoshikiGUI.fxml"));
You must specify(Edit) or add src to your Controller class Path in FXML file also
In FXML File
<VBox alignment="TOP_CENTER" maxHeight="600.0" maxWidth="500.0"
minHeight="600.0" minWidth="500.0" prefHeight="591.0" prefWidth="500.0"
spacing="1.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1"
**fx:controller="src.application.FutoshikiGUIController**">
Above lines are helpful when you are loading Eclipse JavaFX project into BlueJ IDE