next up previous
Next: Step 2 Up: The Generic Image Previous: The Generic Image

Step 1

The first step is to obtain the image to be processed. This is achieved using

     Image_src = getImage(getCodeBase(), image_name);
where Image_src is an Image object, getCodeBase() obtains the path where the compiled program resides and image_name is a String object which contains the name of the image which can either be obtained from an HTML document or by default (using getParameter)

     String image_name = getParameter("image");
     if (image_name == null) image_name="images/simon.gif";

The method getParameter() obtains the value of the image parameter in the HTML document that holds the applet. If no such parameter exists then a default value compiled with the applet is used. The combined code above results (if no HTML parameter is found) in the image simon.gif to be loaded. This image must reside in the sub-directory images of the directory holding the executable applet code.



Bob Fisher
Fri Jul 4 16:11:50 BST 1997