I am planning on starting the development of a desktop app, but until now, for me, desktop = swing. I did a little research about it and found myself under some questions:
I found that there are a lot of JavaFX versions:
But even with the most recent NetBeans IDE version (8.0) with JDK 8 (1.8.0), when I create a JavaFX application, it starts using JavaFX 2.2 – Is JavaFX 8 really a new JavaFX version or people say it just because they use JavaFX 2.X with JDK 8?
Another question about versions, will applications developed in a version X of JavaFX be compatible with higher versions? Just like a swing application, where if you developed an application in Java 5, it would work even on Java 8.
About development patterns, more specifically about layout creation, I noticed there are two ways for creating layouts: By just coding it in Java, and by creating XML files (FXML) with a Java Class as a controller (More MVC approach) just like a JSF application. Which one should I choose? What are the pros and cons of each one?
I am not sure why you are facing such an issue of JavaFX 2.2 with JDK 1.8 because JDK 8 has JavaFX 8 in it and it must be used by default.
Just to give a quick introduction on JavaFX and how it is different from Swing. Please follow the following points:
For more differences on Swing and JavaFX please follow (though the answers are old and many things have changed. JavaFX has become bigger and better!)
https://stackoverflow.com/questions/1318645/JavaFX-or-swing
JavaFX 2 vs Swing for a pure Windows desktop app
Difference between JavaFX 1+, 2+ and 8+
Compatibility - All JavaFX application is forward compliance, i.e. JavaFX 2.0+ is compatible with Java 7, 8 and above. Though applications made using JavaFX 8 is not compatible with Java 7.
JavaFX 1.3 support has been killed from Java 1.7.
Development Patterns
From Oracle docs
From a Model View Controller (MVC) perspective, the FXML file that contains the description of the user interface is the view. The controller is a Java class, optionally implementing the Initializable class, which is declared as the controller for the FXML file. The model consists of domain objects, defined on the Java side, that you connect to the view through the controller.
Some more information and pro's for FXML, please follow:
Which is better way of programming in javafx?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With