Java Reference
In-Depth Information
What is interesting to see is the control performed before creating a new document—embed-
ded draw in method addComponent (lines 123-134 of Listing 13.3). This warns the user before
using this functionality if not already cached because it requires the download of some JAR
files through JNLP. Figure 13.2 shows what happens the first time the user adds a draw to the
document (assuming that the draw add-on module is not already installed).
F IGURE 13.2
Our application requires the user authorization before using a feature that will imply a resources download.
13
N OTE
The “lazy” download of resources is not supported as mandatory in the JNLP specifi-
cation, so this feature may not even be implemented on some JNLP Clients, or it may
be implemented in different ways (for example, resources smaller than a given size
are downloaded eagerly). Hence, depending on your JNLP Client, the confirmation
window may not appear at all. For more details on such a feature, see Chapter 10,
“Defining the Client Environment.”
After the first authorization, the add draw button will not cause the confirmation dialog box to
appear anymore, and the drawing functionalities are available to the user, as shown in Figure
13.3.
An interesting use of JNLP runtime services is provided by the “about” dialog box, shown in
Figure 13.4. In Listing 13.4, its code is presented. This JDialog subclass is activated at line
116 of Listing 13.5.
Search WWH ::




Custom Search