[Notes & References] [Examples Coverd in Lab] [Assignments & Solutions] [Student Project Notes & Hints] [Student Project Showcase]
Be sure to check out the showcase of student projects below!


The main website for the Java Programming portion of the camp is Dr. Franco's website at:
This website contains information/examples specific to the Beginners-Section of the camp.

Notes & References

Some helpfull links for getting started and working at home

Class Notes Start Here! Downloads Various Online Resources
Official java.sun.com Documentation
The following are exhaustive references on each of the topics we're covering in class, provided by Sun Microsystems.
While in-depth, they are brief, and relatively well-written. If you're wanting to dive-in and learn more about Java, check these out.

Examples Coverd in Lab

All of the examples we cover during camp will be linked to here.

First Applets Getting a feel for Eclipse, Java, and Applets.
  1. HelloWorld (view source). Everyone's classic first program.
  2. HelloWorldWithImage (view source). Extending the previous program with an image and simple drawing.
  3. FirstUI (view source). Building your first user interface with buttons and a text-area.
  4. SimpleSongPlayer (view source). A simple song-player in Java.
  5. UsingMouse (view source). Capturing mouse-related events in Java.
Core Java Data Types, Control/Flow Structures in Java.
  1. Generic (view source). This is a generic applet that we'll play with during our discussions.
  2. GenericWithScrolling (view source). Same as above, only the output window has a scroll-bar.
  3. RegularJava A "Regular" (non-Applet) Java program.
  4. WhileLoop (view source). Example use of a while-loop.
  5. ForLoop (view source). Example use of a for-loop.
  6. ClassesMethods (view source). Example use of a classs and methods, building an AddressBook class.
  7. try-catch Example: no catch.
  8. try-catch Example: with catch.
Graphics, Animation, and Games ... Oh my!
FINALLY! Some fun stuff!
  1. Basic Graphics: HomerWantDonut (view source).
    Drawing Homer, moving him around, and of course, donuts.
  2. Basic Animation using Threads: HomerMovement (view source).
    Same as the above, only now Homer can fire Donuts of Death!
  3. Starter Game: AngryHomer (view source).
    A full (but relatively simple) game where Homer must fire his Donuts of Death to destroy his enemies: Ned Flanders and Mr. Burns.
  4. Game Engine: View the source of the game engine here: GameEngine.java.
    Just import that file into your existing Eclipse project, and write your applet in another file. Eclipse/Java will take care of the rest. View the sample applets below to see how to use the GameEngine.
    1. Simple Example (view source)
    2. AngryHomer (view source)
    3. PuttPutt (view source)

Assignments & Solutions

  1. Eclipse and Java Basics
  2. Control Structures & Arrays
  3. Classes & Methods I
Solutions These are posted after we cover solutions in class.
  1. TempConverter.java, Powers.java.
  2. MaxArray.java, SortArray.java.
  3. AddressBookWithAddress.java, PowersMethod.java, Fibonacci.java.

Selected Notes/Hints for Individual Student Projects

Arvind: Putt-Putt Golf
Brianne: Sudoku Player
Deepak: Representing and Working with Baseball Stats
  1. First, before looking at the small example I have put together, read the following discussion on the Map data structure... Topic: The Map Data Structure.
  2. View the sample applet in action here: Deepak.
  3. Perhaps a GUI layout you might be interested in: SampleGui (view source).
Ethan: Getting System Stats from within Java
Some handy Windows commands you'll want to use in your program... Some Examples building up to what you'll want/need just to launch external programs and read+parse their output...
  1. ReadCommandOutput.java How to launch an external program from within Java and read the output of that program.
  2. ParseCommandOutput.java Extension of the above. Also shows you how to parse the output of the external program (that is, break up each line into its components/columns).
  3. ParseAndStoreCommandOutput.java Extension of the above. This one shows you how to, essentially, build arrays corresponding to each "column" of output that you want. You can then use these arrays to quickly "dig through" the data and compute what you want.
ALSO! Good news, it's possible to do this stuff from within a Java applet, provided the computer you view the applet with grants your applet permissions to do this stuff... it's disabled by default for security reasons. I'm talking with Dr. Franco to figure out how to get this working on Windows, and I'll let you know when I figure it out.
Emerald: Painting in a Java Applet
Maulik: Games
Kent & Nelson Playing Music in Java Applets

Showcase of Student Projects


Brianne had an interest in creating her own Sudoku player in Java, where she could have it automatically check a given row, column, or sub-square to see if it was valid. Dr. Franco had a Sudoku solver example on his website, so she took that and started working, using the interface and basic structure his example provided.


Deepak built a brand new application where you can view statistics for baseball teams and their players, and even predict what the statistics will be for a given team. He built his application from scratch, with very little help from myself or the TA's. He even utilized a Map data structure for representing the relationship between teams, players, and their statistics.


Emerald had an interest in writing an image composing/manipulation program, similar to Microsoft's Paint program. She had the basic application finished in only two days, and worked almost entirely on her own! The end result was not an applet, but rather a standalong "regular" Java program. I've Applet-fied her code to be shown here.


Ethan wanted to build an application that would display various statistics about the computer it was running on, such as CPU utilization, RAM usage, and more. Java, strictly speaking, doesn't provide such information easily. So Ethan wrote an applet that actually launches other programs on the computer that do provide such information, and he then reads the output of these programs and parses through it to get the information he wants.


Level 1 (easy) Level 2 (difficult)
Yasmine really enjoyed the Homer Wants Donut game that we covered in lab, so she decided to extend it and make a real game out of it. In the game, donuts and carrots randomly appear around Homer. The goal is to eat as many donuts as you can (+1 point for each donut) while avoiding the healthy and nutritious carrots (-5 points for each carrot). Level 1 is quite easy... Level 2 is quite difficult!

These images shamelessly copied from here.