Download the CyberPet.java and the CyberPetApplet source files. These files correspond to the programs developed in this chapter. Place both of these files into the same directory.
Compile and run CyberPetApplet to make sure it runs properly. If you are using JDK, you can compile both CyberPetApplet.java and CyberPet.java by simply typing
javac CyberPetApplet.java
at the command line. The compiler will look for CyberPet.java in the same directory and will compile it automatically. To run the applet with JDK you will need an HTML file which contains the following applet tag:
<APPLET CODE="CyberPetApplet.class" WIDTH=325 HEIGHT=75>
</APPLET>
Assuming the HTML file is named CyberPetApplet.html, you can run it with the appletviewer by typing
appletviewer CyberPetApplet.html