The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Deployment
Lesson: Java Web Start

Developing Java Web Start Applications

For the most part, you develop applications to be deployed through Java Web Start just as you would develop stand-alone Java applications. However, there are some packaging considerations, which are described in the following sections:

Packaging the Application in JAR Files

To deploy an application with Java Web Start, you must package the application as one or more JAR files. In particular, you must package the application's files into one or more JAR files.

Note : Other resources such as images and property files can, if necessary, be outside of JAR files and retrieved using HTTP requests. However, storing resources in JAR files is preferred, because JAR files are cached on the local computer by Java Web Start.
If the application needs unrestricted access to the local system, all JAR files and entries must be signed. For more information, see the
Java Web Start and Security section.

Reading Resources in a JAR File

Use the getResource method to read resources from a JAR file. For example, the following code example retrieves images from a JAR file:
// Get current classloader
ClassLoader cl = this.getClass().getClassLoader();
// Create icons
Icon saveIcon  = new ImageIcon(cl.getResource("images/save.gif"));
Icon cutIcon   = new ImageIcon(cl.getResource("images/cut.gif"));
The example assumes that the following entries exist in the JAR files for the application:

Untrusted Applications

Unless you sign your application's JAR files, which requires users toa ccept your certificate, your application deployed through Java Web Start is untrusted. Untrusted applications have the following restrictions:

For more information, see the Java Web Start and Security section.

Also see The JNLP API section for information on using the special Java Web Start packages in your applications.


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.