PART IV
Introducing
GUI Programming with JavaFX
CHAPTER 34
Introducing JavaFX GUI Programming
Like all successful
languages, Java continues to evolve and improve. This also applies to its
libraries. One of the most important examples of this evolutionary process is
found in its GUI frameworks. As explained earlier in the book, the original GUI
framework was the AWT. Because of its several limitations, it was soon followed
by Swing, which offered a far superior approach to creating GUIs. Swing was so
successful that it has remained the primary Java GUI framework for over a
decade. (And a decade is a long time in the fast-moving world of programming!)
However, Swing was designed when the enterprise application dominated software
development. Today, consumer applications, and especially mobile apps, have
risen in importance, and such applications often demand a GUI that has “visual
sparkle.” Furthermore, no matter the type of application, the trend is toward
more exciting visual effects. To better handle these types of GUIs, a new
approach was needed, and this lead to the creation of JavaFX. JavaFX is Java’s
next-generation client platform and GUI framework.
JavaFX provides a powerful,
streamlined, flexible framework that simplifies the creation of modern,
visually exciting GUIs. As such, it is a very large system, and, as was the
case with Swing discussed in Part III, it is not possible to describe it fully
in this book. Instead, the purpose of this and the next two chapters is to
introduce several of its key features and techniques. Once you understand the
fundamentals, you will find it easy to explore other aspects of JavaFX on your
own.
One question that naturally
arises relating to JavaFX is this: Is JavaFX designed as a replacement for
Swing? The answer is a qualified Yes. However, given the large amount of Swing
legacy code and the legions of programmers who know how to program for Swing,
Swing will be in use for a very long time. This is especially true for
enterprise applications. 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. JavaFX is something that no Java
programmer can afford to ignore.
Before continuing, 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 also supports FXML, which can be (but is not required to be) used to
specify the user interface. JavaFX has been bundled with Java since JDK 7,
update 4. The latest version of JavaFX is JavaFX 8, which is bundled 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
represents the latest version of JavaFX, it is the version of JavaFX discussed
here. Furthermore, when the term JavaFX
is used in this and the following chapters, it refers to JavaFX 8.
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.