Changing the Java Web Start Splash Screen

Java applications that are launched with Java Web Start have a default splash screen that displays before your application is ready to run on your system. For JavaSE 6 Update 10, this splash screen looks like the following:

You can change this splash image to one with your own GIF, JPG, or PNG file. The first time Java Web Start launches your application you will see the default Java cup logo image. All subsequent launches will display your splash image.

Java Network Launch Protocol (JNLP)

All applications launched with Java Web Start technology have an associated JNLP file (a file name with a .jnlp extension). You need to edit this JNLP file and specify the image you want to use for your splash screen. Essentially, you add one line to the <information> element within your JNLP file:

<icon href="mysplash.jpg" kind="splash"/>

where the mysplash.jpg file is the image file you want to use to replace the default splash image.

Note: For more information about JNLP, refer to the Java Web Start Developers Guide or the JNLP specification.

Here is an example JNLP file with this <icon> line added to the <information> element:

<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for ButtonDemo -->
        <jnlp
     spec="1.0+"
     codebase="http://java.sun.com/docs/books/tutorialJWS/uiswing/components"
     href="ButtonDemo.jnlp">
     <information>
       <title>ButtonDemo</title>
       <vendor>The Java(tm) Tutorial: Sun Microsystems, Inc.</vendor>
       <homepage href="http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html#ButtonDemo"/>
       <icon href="mysplash.jpg" kind="splash"/>
       <description>ButtonDemo</description>
       <description kind="short">Demonstrates use of buttons within containers</description>
       <offline-allowed/>
     </information>
     <resources>
       <j2se version="1.6+"/>
       <jar href="ButtonDemo.jar"/>
     </resources>
     <application-desc main-class="components.ButtonDemo"/>
   </jnlp> 

The JAR file with your application is stored on the web server in a location specified by the codebase value in the JNLP file. The path you specify for your splash image is relative to the codebase value. So for example, in the JNLP file above, the file mysplash.jpg needs to be stored in the directory specified by the codebase.

Try It Out

To see this in action, try this Java programming language ButtonDemo. When you first launch it with Java Web Start technology, the default Java cup logo splash screen displays on your screen before the application appears on your desktop. When you launch the application a second time, the image for the file mysplash.jpg will display before the ButtonDemo application appears on your desktop.

-- Debra Scott

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Blog about Java technology documentation and news about Java releases.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today