Java applet illustration

You may place a Java applet wherever you want it to appear on the page. When the page loads, the applet program and any data it uses are automatically downloaded from the server to your client. In this example, an image-viewing program and several images are downloaded. (Click on the mosaic button to see some old class photos).

If you view the source of this page, you will see the following HTML where the applet appears:

<applet archive="viewer.zip" code="viewer/ImageViewerApplet.class" width="800" height="400"> <param name=ImageList value="1.jpg, 3.jpg, 4.jpg, 5.jpg, 6.jpg, 7.jpg, magimini.jpg"> <param name=bgColor value="#ffffff"> </applet>

The applet tag designates the program to be downloaded to the client. The tag has four attributes:

The applet is contained in a zipped file called viewer.zip. As you see in this listing, viewer.zip contains a number of subprogram classes and one .gif file:

The classes are the subprograms making up the applet, and the gif file is the "Java applet illustration" greeting that is displayed when the program first executes. As specified in the code attribute, the first subprogram to execute will be an instance of the class ImageViewerApplet which is in the viewer subdirectory.

The param tags specify the values of the two parameters that are passed to the applet when it executes:

I downloaded the applet and instructions for using it from BuddySoft.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.