CPSC 124
Java Source Code
THIS PAGE CONTAINS LINKS to the source code for all the applets appearing in the notes for CPSC 124.
- A simple GUI demo applet, from Section 1.6
- Moire1, an animated design, from end of Section 1.8
- Applets from Chapter 2 that similate console input/output:
- The ConsoleApplet class that does the HelloWorld program in Section 2.1; the other console applets are defined as subclasses of ConsoleApplet
- A ConsoleCanvas class that used by all the console applets
- A ConsolePanel class that used by all the console applets
- First investment example, from Section 2.2
- Second investment example, from Section 2.3
- Third investment example, from Section 2.4
- 3N+1 sequences example, from Section 2.5
- Applet that shows multi-colored "Java!"s, from end of Section 2.8
- Applets from Chapter 3 that simulate console input/output:
- Guessing Game, from Section 3.2
- Improved 3N+1 sequences, from Section 3.4
- (These use the same ConsoleApplet, ConsoleCanvas, and ConsolePanel classes as the examples from Chapter 2.)
- Random mosaic, with random walk, from the end of Section 3.6
- The MosaicCanvas class that is used by this applet
- Symmetric random mosaic walk, from the end of Section 4.5
- The SymmetricMosaicCanvas class that is used by this applet (based on the MosaicCanvas class)
- HelloWorld and ColoredHelloWorld applets from Section 5.1
- Simple mouse tracker from Section 5.2
- Applet with lines that track the mouse, from the end of Section 5.4
- EventDemo applet from Section 6.3
- Scrolling text animation applet from the end of Section 6.4
- Maze applet from the end of Section 7.4
- URL Example applet from Section 8.4
- Cellular Automaton applet from the end of Section 8.4
- A class, CACanvas, used by this applet
- Pentominos applet from the end of Section 9.3
Also Available:
- EasyInput.java which defines a class containing a few static methods that make it easier to input data from the standard input stream, System.in.
- Console.java, which defines a subclass, Console, of Frame that can be used for standalone applications like those used in Chapters 2 and 3. This class makes use of the ConsoleCanvas class, which is also used by the console-style applets in Chapters 2 and 3.
- MosaicFrame.java which defines a subclass of Frame for implementing colored "mosaics," as in Section 3.6.
- AsciiInputStream.java, which contains the definition of the FilterInputStream discussed in Section 8.2.