Java Reference
In-Depth Information
works if the end user has a JVM installed that is capable of executing the application. This is not always true. Even
in the desktop world, where a system can be delivered preinstalled with a JVM, there are issues with versioning and
security. Indeed, some applications are hard-coded against a specific version of the JVM. Although vulnerabilities in
the JVM are in most cases fixed very fast, this still requires the end user to always install the latest version of the JVM,
which can be pretty frustrating.
On top of that, browser manufacturers are increasingly reluctant to support alternative embedded platforms. In
summary, relying on a browser and on a local, preinstalled JVM does not provide the best end-user experience.
The client software industry is shifting more and more toward the so-called AppStores. In this concept,
applications can be downloaded and installed that are self-containing. They do not rely on preinstalled execution
environments. The principles originated in the mobile space, where Apple with the AppStore and Android with the
Play store are leading the market. Especially in these markets, single-click installs have a huge advantage over local
downloads, unpacking, manual configuration, and more nightmares.
In Java terminology, a self-contained application means that the application is bundled together with a JVM that
is capable of running the application. In the past, this idea was often rejected because it made the application bundle
too big. However, with increasing memory and storage capacities, and with decreasing costs of sending bytes over the
Internet, this disadvantage is becoming less relevant.
There are a number of technologies being developed currently that help you bundle your application with the
correct JVM version and package it.
The JavaFXPackager, which is developed inside the OpenJFX project area, contains an API for creating self-contained
bundles. This tool is used by NetBeans, and it can be used to generate self-contained bundles with just a few clicks.
Users of maven can use a maven plug-in created by Daniel Zwolenski. This plug-in, which is documented at
http://zenjava.com/javafx/maven/ allows the creation of JavaFX self-contained bundles using familiar
maven commands.
Now that you have the tools installed, we show you how to create a simple JavaFX program, and then we walk
through it in detail. The first program that we've chosen for you is called “Hello Earthrise,” which demonstrates more
features than the typical beginning “Hello World” program.
Developing Your First JavaFX Program: Hello Earthrise
On Christmas Eve in 1968 the crew of Apollo 8 entered lunar orbit for the first time in history. They were the first
humans to witness an “Earthrise,” taking the magnificent picture shown in Figure 1-4 . This image is dynamically
loaded from this topic's web site when the program starts, so you'll need to be connected to the Internet to view it.
Figure 1-4. The Hello Earthrise program
 
Search WWH ::




Custom Search