Guide to Applets
- Physics 2000 Logo: In all its glory.
- Atom: Just your basic 3D atom, which just happens to be inaccurate in terms of electron count, Pauli exclusion principle, scale, and a variety of other scientific niceties.
- Wavefront: Generates a shadowed, circular sine wave, like ripples on a pond.
- Stadium Wave: Simulates a human wave like they do at football games.
- Spectrum: Illustrates the electromagnetic spectrum.
- Lines of Force: Shows the structure of an electric field between two charges.
- Field Waves: Show how one particular "line of force" between two charges (namely, the one that goes straight between them) is affected by an oscillation of one of the charges. Not perfectly accurate, but is kind of fun to play with.
- Orbits: Add electrons in orbit around a nucleus.
- Oscillator: Watch how an orbiting particle and a particle on a spring have the same velocity (aligned with the spring).
- Interfering Waves: See a movie of two waves interfere.
- X-Ray: See a real live demonstration of fluoroscopy!
- Decaying Orbits: What happens when electrons lose energy as they orbit?
- Bohr Atom: Astonish your friends! See a hydrogen atom change energy levels as it absorbs and emits photons.
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:
If the applet is 'packaged':
<applet codebase="../applets" code="myapplet.MyApplet.class" width=100 height=100>
<param name="image" value="myapplet/SomeImage.gif">
</applet>
If the applet is 'unpackaged':
<applet codebase="../applets/myapplet" code="MyApplet.class" width=100 height=100>
<param name="image" value="SomeImage.gif">
</applet>
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.
- ClassNotFound: You're looking in the wrong directory, or have a typo somewhere.
- ClassFormatError: You're looking in the right place, but you've got 'packaged' vs. 'unpackaged' mixed up.
- NullPointerError: Make sure you've got the image parameters right. Otherwise report it to me.
- Freezes with the message 'Loading images...' displayed Make sure you don't have the same image specified for two different params. This error will also break all subsequent applets until you quit and restart Netscape. (This only happens on the Mac).
- AbstractMethodError: Report this to me