Example Java Programs
David Matuszek

Here is a small assortment of my example programs. Anything here is free for you to use in any way you choose.

Fibonacci.java   A simple program for printing Fibonacci numbers.
access.zip    This is a do-nothing program. The only purpose is to demonstrate how to access variables and methods in one class from another class.
Widgets   Two versions of an applet. Both versions demonstrate the use of various Components (widgets); one version uses anonymous inner classes for the Listeners, while the other version uses member classes. The link is to a more detailed description.
Layouts   Examples of BorderLayout, FlowLayout, and GridLayout. The link is to a page displaying both source code and the results.
BouncingBallApplet.zip   The example program used in the Model-View-Controller lecture.
StateMachine.zip   A simple state machine that adds <b>...</b> tags around unsigned integers.
Scott.zip   My implementation of the Scott's problem assignment.
CardGame.zip   My implementation of the 21 Card Game assignment.
Calendar.zip   My implementation of the Calendar assignment.
Caesar.zip   My implementation of the Caesar Cipher assignment.
Rabbit.java   My implementation of the Rabbit class.
Calculator.zip   My implementation of the Calculator assignment.
MagicSquares.zip   My implementation of the Magic Squares assignment.