ich Internet Application or RIAs are all the rage in application development circles now. How do you make web applications behave like more traditional desktop applications? You remember desktop applications don’t you? Harken back to the days of drag-and-drop, slide bars, dynamic widget enabling, disabling, background coloring, etc.—all to make the user experience more pleasing without the “flash-bang,” slow-performing Web page refreshes. Those were some user interfaces!
AJAX is the technology most often used today to provide RIAs that present the closest thing to desktop applications offered over the Web. AJAX has been a part of a new Web revolution,heralded as Web 2.0. The unfortunate aspect of AJAX is its dependency on the platform. Namely, if you have ever written an AJAX application for mass distribution, much of the application code is littered with “if Microsoft IE do…if Mozilla or other browser do…” conditionals. Efforts by the W3C and others to standardize AJAX technologies are helping, but they may not be enough when you’re also considering needs to bring more dynamic applications to other platforms like mobile and consumer devices.
AJAX is based on relatively older software technology. JavaScript, DOM, XHTML, etc. have been around a while and are seeing rebirth in RIA needs. However, industry leaders are waking up to the RIA need and are looking to satisfy it with some new (and some might say better) technology. For example, Microsoft has stepped up with XAML (Extensible Application Markup Language) in the Windows Presentation Foundation of .NET 3.0, where it is used as a user interface markup language to define UI elements, data binding, event handling, etc. Their Silverlight product provides a subset of WPF functionality on mobile devices and other platforms.
JavaFX was heavily spotlighted at this year’s JavaOne conference and it’s clearly Sun and the Java community’s most current entry to the RIA competition. JavaFX is actually intended to be a family of products initially comprised of JavaFX Script and JavaFX Mobile. JavaFX Script (JavaFX for short) is a scripting language meant to provide rich user interfaces using syntax that resembles JavaScript and Scalar Vector Graphics (SVG). As its name implies, JavaFX Mobile is intended for use on mobile platforms.
This article introduces you to the new JavaFX Script language. I point you to some JavaFX syntax and API tutorials and take you through some of the interesting characteristics that might make JavaFX appealing. It is a technology still in its infancy, but if you are thinking RIA long term, it’s a technology worthy of inspection. Why? As the JavaFX FAQ states:
| “JavaFX Script will enable developers to more quickly and easily develop RIAs and next-generation services that can be proliferated across virtually any device—from desktop browsers and mobile devices, to set-top boxes and Blu-ray Disc DVDs—securely and without local installation.” |
Java is the dominant application platform on handsets. Marry that lead, the “write once, run anywhere” mantra, and the need for RIA, and you start to understand why Sun is pushing hard to establish JavaFX as a powerful development technology. Sun wants to keep and expand Java deployments and JavaFX is a means to that goal.
A recent (July 2007) podcast given by Jacob Lehrbaum, Sun’s JavaFX Mobile product line manager, suggest that Sun will be working with device vendors this fall in order to bring JavaFX Mobile-capable devices to market in 2008. Even development tools are still a few months off. In the podcast, he says “I think it’s a little bit early to start working with [JavaFX Mobile] as we are still defining the platform and building out some of those capabilities.” He recommends getting familiar with JavaFX Script via OpenJFX (more below) and NetBeans plugins as a means to get ready for this new mobile device capability.
Set Up JavaFX
All that is required to run JavaFX scripts on the desktop is a JRE. Both Eclipse and the NetBeans IDEs already offer plug-ins to start working with JavaFX; getting set up to learn it is pretty painless.
To configure NetBeans 5.5 for JavaFX, simply use the built in NetBeans Update Center (see Figure 1). Through the OpenJFX project and web site, Sun provides step-by-step instructions on how to use the Update Center and configure NetBeans 5.5 with the JavaFX plug-in.
Figure 1. The NetBeans Update Center: Here’s where to retrieve and configure the JavaFX plug-in for use in NetBeans. |
Figure 2. The Eclipse Features Update: Use this mechanism to locate and install the JavaFX plug-in. |
Specifically, these instructions have you install the OpenJFX implementation of JavaFX. OpenJFX is the Sun project for “sharing early versions of the JavaFX Script language and for collaborating on its development.” A plug-in is also available for those that have already graduated to the NetBeans 6 Preview.
Likewise, if you’re using Eclipse (version 3.2), you download and install a plug-in for Eclipse. Use the find and install option in Eclipse to download and configure the plug-in (see Figure 2).
If you’d rather not use an IDE, OpenJFX offers a download that includes the bare minimum; that is the JavaFX Script runtime, library source, and demo source code files.
More Questions Than Answers
JavaFX enters a young and burgeoning RIA marketplace.Will it survive? Will it become the UI scripting language of choice especially for Java developers? It is still too early to make that prediction. However, given its ties to Java and the ability to take RIAs beyond the desktop browser into mobile and consumer devices without rewrites is an attractive offering worthy of exploration and careful study today with possible implementation contemplation tomorrow.
Related Articles
- A Veteran JFC/Swing Developer Makes the Leap to JavaFX Script
- Using JavaFX Mobile to Combat Device UI Fragmentation
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.
























