File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JavaFX and the fly likes Generating FXML file from JavaFX Java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Generating FXML file from JavaFX Java code" Watch "Generating FXML file from JavaFX Java code" New topic

Generating FXML file from JavaFX Java code

Tom Hawk

Joined: Jun 12, 2008
Posts: 2
I have inherited a JavaFX applcation where the GUI is created and layed out entirely in Java code. I would like to convert this app to use an FXML file so that I may use SceneBuilder. Is there a way to automatically generate an FXML file from an existing JavaFX application?

Dennis Grimbergen
Ranch Hand

Joined: Nov 04, 2009
Posts: 152

As far as I know there is no tool which can do that. Do you expect such a tool to give nice clean fxml?
The fxml element names match the javafx class names in general. So why not make that fxml by yourself?

To my opinion Scene builder is handy to see what fxml is generated by putting some nodes on some pane. But it's limited in its usage/options compared to what is possible with JavaFX.

I agree. Here's the link:
subject: Generating FXML file from JavaFX Java code
jQuery in Action, 3rd edition