Java Reference
In-Depth Information
Create a TextField
Add effects
Apply transforms
I n the fast-paced world of computing, change is constant, and the art and science of pro-
gramming continue to evolve and advance. It should not then be surprising that Java's GUI
frameworks have also participated in this process. Recall that Java's original GUI frame-
work was the AWT. It was soon followed by Swing, which offered a far superior approach.
Although Swing has been very successful, it can be difficult to create the “visual sparkle”
that many of today's applications demand. Furthermore, the conceptual basis that underpins
the design of GUI frameworks has advanced. To better handle the demands of the modern
GUI and advances in GUI design, a new approach was needed. The result is JavaFX, Java's
next-generation GUI framework. This chapter provides an introduction to this powerful
new system.
It is important to mention that the development of JavaFX occurred in two main phases.
The original JavaFX was based on a scripting language called JavaFX Script . However,
JavaFX Script has been discontinued. Beginning with the release of JavaFX 2.0, JavaFX
has been programmed in Java itself and provides a comprehensive API. JavaFX has been
bundled with Java since JDK 7, update 4. The latest version of JavaFX is JavaFX 8, which
is included with JDK 8. (The version number is 8 to align with the JDK version. Thus, the
numbers 3 through 7 were skipped.) Because, at the time of this writing, JavaFX 8 repres-
ents the latest version of JavaFX, it is the version of JavaFX discussed here. Furthermore,
when the term JavaFX is used, it refers to JavaFX 8.
Before we begin, it is useful to answer one question that naturally arises relating to
JavaFX: Is JavaFX designed as a replacement for Swing? The answer is, essentially, Yes.
However, Swing will be part of Java programming for some time to come. The reason is
that there is a large amount of Swing legacy code. Furthermore, there are legions of pro-
grammers who know how to program for Swing. Nevertheless, JavaFX has clearly been
positioned as the platform of the future. It is expected that over the next few years, JavaFX
will supplant Swing for new projects, and many Swing-based applications will migrate to
JavaFX. Simply put: JavaFX is something that no Java programmer can afford to ignore.
NOTE
Search WWH ::




Custom Search