Java Source Code
End-of-Chapter Applets
This section contains the source code for the applets that are used as decorations at the end of each chapter. In general, you should not expect to be able to understand these applets at the time they occur in the text. Many of them use rather advanced techniques. By the time you finish the course, you should know enough to read the sources for these applets and hopefully learn something from them.
- Moire.java, an animated design, from end of Section 1.8. (You can use applet parameters to control various aspects of this applet's behavior. Also note that you can click on the applet and drag the pattern around by hand. See the source code for details.)
- JavaPops.java, and applet that shows multi-colored "Java!"s, from end of Section 2.8. (This depends on SimpleAnimationApplet.java.)
- RandomMosaicWalkApplet.java, showing a grid of randomly colored squares with a moving disturbance, from the end of Section 3.6. This is an applet implementation of the program RandomMosaicWalk.java. (This applet depends on MosaicCanvas.java.)
- SymmetricWalkApplet.java, showing a symmetric pattern of colored squares, from the end of Section 4.5. This file is a slight modification of RandomMosaicWalkApplet.java. (Depends on MosaicCanvas.java.)
- ScrollingMessage.java, from Section 5.5. This animation is also used as a coding example in the text, and it is listed above as well as here.
- TrackLines.java, an applet with lines that track the mouse, from Section 6.6. This applet uses Java 1.0 style event handling.
- Maze.java, an apple that creates a random maze and solves it, from Section 7.4.
- SimpleCA.java, a Cellular Automaton applet, from the end of Section 8.4. This applet depends on the file CACanvas.java.
- LittlePentominosApplet.java, the pentominos applet from the end of Section 9.3. This file defines two classes, LittlePentominosApplet and PentominosBoardCanvas. A pentomino is made up of five connected squares. This applet solves puzzles that involve filling a board with pentominos. If you click on the applet it will start a new puzzle. This applet uses the old-fashioned Java 1.0 style event-handling.