A default loading screen is displayed when an applet is being loaded in the web page. You can customize this loading screen by specifying the following parameters when you deploy the applet:
image
- the image to be displayed in the loading screenboxbgcolor
- the background color of the area in which the applet will be displayedboxborder
- whether the applet should have a border; defaults totrue
centerimage
- the position of the image; defaults tofalse
The loading screen can display a static image or an animated gif.
The code snippet from
shows how to customize the loading screen to display an animation of the Duke, the Java mascot.
AppletPage.html
<script src="http://www.java.com/js/deployJava.js"></script> <script> var attributes = {code:'SwingSet2Applet.class', archive:'SwingSet2.jar', width:695, height:525} ; <!-- customize splash screen display options --> var parameters = {jnlp_href: 'SwingSet2.jnlp', image: 'dukeanimated.gif', boxbgcolor: 'cyan', boxborder: 'true', centerimage: 'true' } ; deployJava.runApplet(attributes, parameters, '1.6'); </script>Open
in a browser to view the custom loading screen when the SwingSet2 Demo applet is loaded. If you've clicked this link before and viewed the SwingSet2 Demo applet, make sure to clear your cache using the Java Control Panel. You may not see the loading screen if the applet loads very quickly.
AppletPage.html
Note: If you don't see the applet running, you need to install at least the Java SE Development Kit (JDK) 6 update 10 release.
Note: If you don't see the example running, you might need to enable the JavaScript interpreter in your browser so that the Deployment Toolkit script can function properly.Download source code for the Customizing Loading Screen example to experiment further.