Guide to Applets

Usage Notes

The instructions for each applet have information about parameters and whether the applets is "packaged" or "unpackaged". To use an example, if we have an applet called "MyApplet.class" that takes a single parameter called "image", and is physically located in a directory applets/myapplet, here are the two implementations:

Also note that the example assumes we are in a sibling directory (same parent) as 'applets' and that the image file is in the 'myapplet' subdirectory. Image files can be anywhere as long as you specify how to find them in the parameter. If you don't get errors, but the images don't appear, check this.

If the Instructions for the applet don't tell you if it's packaged or unpackaged, you can tell my looking at the HTML, and checking where the HTML file is located. If it 'starts' in the parent directory of the applet, it's packaged. If it 'starts' in the applets own directory, it's unpackaged. Finally, bear in mind that many of the examples on this page are already in the 'applets' directory, so I left out the 'codebase' because it's already starting from the right place.

Common Errors

If the applet doesn't appear, put the mouse where the applet should be and look at the message bar at the bottom of Netscape. Or pick "Show Java Console" from the Options menu and read the last error.