Java Reference
In-Depth Information
Depending on the JNLP Client, we can use some platform-dependent facilities such as setting
shortcuts or something similar in order to ease the application launch. As a default, Java Web
Start asks the user the second time the application is launched whether to create such facilities,
as shown in Figure 8.7.
F IGURE 8.7
Web Start prompts the user for shortcuts (on Windows) the second time we launch our editor.
Now that we have a more precise idea of what a typical JNLP-launched application looks like,
it's time to explore some of the other features JNLP makes available to developers.
8
An Installer
Avery interesting and commonly used feature of JNLP allows you to take control of the
installation process with our Java code that substitutes the JNLP Client job. This example will
provide a simple reusable component (a JNLP-aware splash window), an example of a JNLP
file that specifies an installer, plus a practical example of how to use the runtime services
offered by the JNLP Client environment (this will be fully discussed in Chapter 11).
We want to use our own installer code, both because we want to enforce our own deployment
rules (for example, given the user type, we want to install only basic functionalities and not the
full application), or because we simply want to hide the JNLP Client's splash window (see the
next section) with our own in order to avoid end-user disorientation, to offer a better product,
or for some other reason. The splash window class can be adapted to a variety of situations,
but now let's see how it works.
When we launch the app.jnlp file, the following events happen:
1.
The JNLP Client (that is, Java Web Start) will start, loading the app.jnlp file and inter-
preting it as a normal JNLP file.
2.
Because the app.jnlp file includes a link to our custom installer, the JNLP Client stops
installing the application and retrieves the installer JNLP file, namely splash.jnlp .
3.
The JNLP Client parses the splash JNLP file, and launches its related code (note that
the application has not been launched yet). The installer code (class Splash.java con-
tained in the splash.jar file) then performs the rest of the application installation.
Search WWH ::




Custom Search