Java Reference
In-Depth Information
and mobile applications, but is now geared toward replacing Swing as the standard GUI toolkit for
Java, although Oracle will continue to offer both in the foreseeable future.
Note that JavaFX has been around since 2008, but it took a few years until the library was ready for
use on non‐Windows platforms. With the release of Java 8, JavaFX became an integral part of the
JRE (and JDK), so that the latest version of JavaFX went from 2.2 to just simply JavaFX 8. These
aspects form the main reason behind the lack of larger adoption of this GUI toolkit. Even though
Oracle has been trying to put more effort behind the project in recent years, it can be argued that the
time for a big breakthrough has passed, and even though the toolkit keeps improving, most people
still stick to Swing as their default GUI toolkit today. Another reason why the framework is not yet as
popular as it could be is because most of the GUI‐related innovations these days tend to focus on web
and mobile development, with standard desktop application development being more stabilized.
Note Speaking of platforms, Oracle—and Sun before them—has missed the
boat somewhat regarding the creation of a GUI framework for Java on mobile
platforms, i.e., iOS and Android. For Android, Google has driven a great deal of
attention toward creating a nice‐looking set of widgets (Android itself runs heav-
ily on Java technology). Although Oracle had an internal prototype of JavaFX
working on iOS and Android at one point, the code base was renamed and
reworked significantly afterwards (called RoboVM on iOS). Even today, these
mobile UI toolkits are considered experimental and not yet ready for prime time.
Other toolkits and Libraries
Apart from the ones you've just seen, there are a number of additional GUI toolkits and libraries
as well. For instance, there are add‐on libraries oriented toward extending Swing with additional
helpful components, such as JGoodies or SwingX from SwingLabs, a library which also contains
a number of Swing components. There also exist additional libraries that try to offer a complete
solution, such as Apache Pivot, which is trying to position itself against JavaFX by offering a com-
pletely open-source package (parts of JavaFX are still proprietary). There's also Qt Jambi, a binding
between the Qt GUI toolkit (that works across various platforms) and Java, as well as GTK‐Java,
which does the same for Java and the GTK GUI toolkit. Finally, as noted before, in case you might
be interested in developing apps on Android later (which are written in Java), keep in mind that the
platform comes with its own GUI toolkit and thus its own set of components and classes, although
learning GUI libraries gets easier once you have seen one.
Choosing a GUI Library
In this section you've seen an overview of several GUI libraries, and by now you might be getting
worried or overwhelmed by the number of choices offered. Which one is the best? Which one is easi-
est to learn? Which one should you go for?
For most of this chapter, you will continue with Swing. The reasons for this are because Swing is
very robust, pretty easy to work with (as long as your GUIs don't need to be very complex), and well
known by Java programmers, so you can easily find or get help. Remember that using Swing will
always involve talking a little bit about AWT as well, which Swing extends.
 
Search WWH ::




Custom Search