Thursday 11 January 2018





Difference between Java and JavaFX



Sun Microsystems tried several ways to make it easier to create Java applications. One of these was a scripting language called JavaFX 1.0 which tried to compete with Adobe Flash and Microsoft Silverlight. This allowed users to build much more complex user Interfaces (which could also include advanced timelines for events) than was possible in Swing.
It did not really take off (but managed to be the theme of several JavaOne conferences in the late 2000s). JavaFX was not Java (so it never really caught on with Java developers who did not want to learn yet another language) and it offered no real compelling advantage to non-Java developers.
When Oracle acquired Sun Microsystems, there was a major review of all activities. They killed off JavaFX as a scripting language but added the functionality into Java (with Java commands) and enhanced it as the new way to develop user interfaces.
While there is no longer a Scripting language, JavaFX can still be written as either Java commands or as XML commands (FXML) which Java can load. This means that you can separate the User interface from the code, and there is a nifty JavaFX designer called SceneBuilder to create layouts in FXML.
Java continues to contain the Swing library (lots of programs still use it), and Swing and JavaFX can be used together. But for writing new Java applications, JavaFX offers a much simpler way to create desktop applications. In JavaFX you can write more powerful applications with much less code.

Difference between Java and JavaFX Sun Microsystems tried several ways to make it easier to create Java applications. One of ...