I took a look at JavaFX 1.0 not long after it was released in this article. Two years have passed, and JavaFX has reached version 1.2, just released with significant changes to the language and the API. Applications
The basic nature of JavaFX continues to be creation of GUIs (Graphic User Interfaces) in a declarative language format that defines interface components from Java's well developed "Swing" interface toolkit plus a variety of display effects including animation, vector graphics, audio tracks and video, all running in a Java JVM. Many of the new features in 1.2 are related to flashy display effects. There are also significant additions which will be useful in accessing Web services.
The JavaFX language creates computation functions in a style familiar to Java programmers, with classes extending base classes and implementing interfaces. Version 1.2 brings a new feature which may surprise you: the "mix-in" class declaration modifier. A mix-in class cannot be instantiated directly, rather like the java "abstract" class, but a custom class can extend any number of mix-in classes. Java has insisted on single inheritance in the class hierarchy. If you want multiple inheritance, here is your chance to try it. I wonder if mix-in may make it back to standard Java!
Downloading the JavaFX release
The JavaFX 1.2 sdk can be downloaded from this site, in a 46MB installer. As with previous releases of JavaFX, you can get a combined download of the NetBeans 6.5.1 IDE plus the JavaFX release. You can also download just the plug-in if you already have the latest NetBeans installed. Although one Sun Web page says Java JDK 5 is sufficient, this page says JDK 6 update 13 is the minimum for developers and update 14 is recommended. In addition to Windows (XP or Vista), Mac OS X is supported while Solaris and Linux versions are still in beta release.
The SDK includes extensive API documentation in a jazzed up version of the familiar JavaDoc presentation. Warning: not all online JavaFX reference material at the Sun sites has caught up with version 1.2, so be careful. Even the SDK documentation has large gaps, which I hope Sun will fill in as rapidly as possible. Perhaps they were feeling rushed by the competition. Fortunately the Sun developers and other enthusiastic programmers are active bloggers, so searching the Web can locate many useful examples.
Support for data feeds from Web services
As with GUI programming in any language, you must never use the programming thread which handles user inputs from a keyboard or mouse to execute long running tasks. The JavaFX API is full of tools for starting and controlling tasks. Of particular interest for programming Web service clients is the HttpRequest class in the javafx.io.http package. HttpRequest lets you specify a URL and HTTP method and start a request which will proceed asynchronously. Callback functions are defined so that your code will receive notification as the request is processed and the response is returned. HTTP methods GET, POST, PUT and DELETE are supported making it easy to access RESTful Web services.
RSS and ATOM are simple Web service "feed" formats for publishing small chunks of frequently updated information in well defined XML formats. JavaFX provides specific classes for interpreting events from an XML pull parser in terms of the RSS or ATOM standard information components. These classes make it easy to create "mashup" style applications which gather information from all over the Web.
Deploying your JavaFX application
What about the competition?
Competition to be the technology of choice in the Rich Internet Application (RIA) field continues to be fierce. I consider Adobe the foremost RIA technology company due to the long history and huge installed base of the Flash browser plug-in and the PDF Reader. Desktop applications using Flash technology can be created with Adobe Integrated Runtime (AIR), now in version 1.5.1. Adobe is continuing an aggressive development schedule and has moved major chunks of the technology under open source licensing schemes. An active developer community has created a large number of AIR applications.
Microsoft's entry in the RIA field is called Silverlight, distributed as a browser plug-in. Similar to JavaFX, the user interface is created in a declarative XML format with programming logic taking advantage of the .NET framework. Support for downloading content from Web services in XML and JSON format, in addition to various graphic media formats, is a major advantage. Silverlight version 3, now in beta release, provides, among other improvements, a way to install a Silverlight application on a desktop.
To me, the surprise of the RIA race has been Google. The huge acceptance of Google Earth as a browser plug-in and desktop application shows what a tool dedicated to a particular kind of data, as opposed to the generalized tools discussed above, can accomplish. An enormous research budget and an appetite for innovation have created a huge number of desktop applications, gadgets and browser plug-ins.
This was first published in June 2009