Sending Parameters to the Applet

Because the Animate applet relies on parameters to specify the image files it should display, you need to create a web page containing these filenames before you can test the program. After saving and compiling the Animate.java file, open up a new file in your word processor and call it Animate.html. Enter Listing 24.2 into that file and save it when you're done.

Listing 24.2. The Full Text of Animate.html
1: <applet code="Animate.class" width="215" height="298">
2: <param name="image0" value="lh0.gif">
3: <param name="image1" value="lh1.gif">
4: <param name="image2" value="lh2.gif">
5: <param name="image3" value="lh3.gif">
6: <param name="pause" value="800">
7: </applet>

This file specifies four image files: ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.