When testing out JavaFX 2, you might notice that it borrows a lot of concepts from Java EE, like binding and controllers. But another thing is that JavaFX 2 let’s you build desktop app UIs with XML. Indeed, one of the biggest additions is the addition of FXML, a new-ish kind of file that contains all the controls of your UI. The benefits are that it is simple to understand, and even though there is no Java code, there are some imports like in a Java class.
The addition of properties in JavaFX 2 lets you encapsulate a Java type: String, int, boolean etc, and can have listeners. There is also a chart API for creating, customizing and interacting with charts, which are dynamically updated when the data set changes. You get a media engine that supports audio and video streaming, a web engine that gives you a WebKit based browser for web content within your app, plus custom component creation, ImageOps and 3D support that comes along with Java 8
Two additional features increase your ability to do rapid application development with JavaFX 2: first, there is SceneBuilder, which lets you drag-and-drop components into the scene and from there generate an FXML file—CSS previewing is also built-in. ScenicView allows developers to change components and modify CSS while the app is running, so you can see results on the fly.
All in all, JavaFX 2 is better than Swing by orders of magnitude, and improves upon JavaFX 1 in all the ways we hoped for. Maybe it’s time to give it a shot…