Welcome to the JavaFX World
I'm not sure why you came across such a JavaFX 2.2 issue with JDK 1.8, because JDK 8 has JavaFX 8 and should be used by default.
Just for a quick introduction to JavaFX and how it differs from Swing. Follow the steps below:
- Instead of following the rules of building a view / user interface in Java code and ruining function codes with representations, you get the ability to split a view with functionality using FXML , introduced in JavaFX 2.0 +
- JavaFX has powerful CSS integration that allows you to decorate a view that was not available in Swing .
- Development is faster because you are a SceneBuilder to support you.
For further differences from Swing and JavaFX, please follow (although the answers are old and a lot has changed. JavaFX has become bigger and better!
https://stackoverflow.com/questions/1318645/JavaFX-or-swing
JavaFX 2 vs. Swing for a clean Windows desktop
Difference between JavaFX 1+, 2+ and 8+
- JavaFX 1+ was basically a scripting language called JavaFX script, which was very different from Java.
- JavaFX 2.0 has changed the face of JavaFX. The entire JavaFX API is now available as a pure Java API. FXML was also introduced at this point in JavaFX!
- JavaFX 8.0 leads to a new look for JavaFX, where JavaFX is accepted as an integral part of Java 8 .
Compatibility . All JavaFX applications correspond to direct correspondence , i.e. JavaFX 2.0+ is compatible with Java 7, 8 and higher. Although applications built using JavaFX 8 are not compatible with Java 7 .
JavaFX 1.3 support has been killed since Java 1.7.
Development Templates
- JavaFX makes it possible to create your application using your choice, i.e. use an outdated method of constructing views using pure Java or use FXML .
- JavaFX strictly follows the MVC pattern, sharing your view and its events. Views are created using FXML , and controllers are Java files.
From Oracle docs
From the perspective of the Model Representation Manager (MVC), the FXML file that contains the user interface description is the view. The controller is a Java class that optionally implements the Initializable class, which is declared by 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.
For more information and pro for FXML , follow these steps:
What is the best way to program in javafx?
source share