Search code examples
javafxjavafx-2fxmljavafx-8scenebuilder

What are the pros and cons FXML?


What are the pros and cons of using FXMLs or not using FXMLs for developing JavaFX applications?

For developing enterprise JavaFX application which approach should one follow?


Solution

  • FXML Cons: It takes slightly longer to load and display.

    FXML Pros:

    • Rapid scene development / mock up using Scene Builder.
    • FXML is not a compiled language; you do not need to recompile the code to see the changes. Just reload the FXML file.
    • It provides a clear separation of GUI from logic/controller.
    • So you can have different versions of a scene/view using the same controller. This is handy for demo's for instance.
    • The content of an FXML file can be localized as the file is read.

    Definitely use FXML in enterprise apps !