[Notes & References] [Examples Coverd in Lab] [Assignments & Solutions] [Student Project Notes & Hints] [Student Project Showcase]
Also check out the 2009 Beginner Java Website.


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 (By Category)

All of the examples we cover during camp will be linked to here.
First Applets
  1. HelloWorld (view source)
  2. HelloWorldWithImage (view source)
  3. FirstUI (view source)
  4. SimpleSongPlayer (view source)
  5. UsingMouse (view source)
Core Java
  1. Generic (view source)
  2. GenericWithScrolling (view source)
  3. RegularJava
  4. AccessTest (view source)
  5. WhileLoop (view source)
  6. ForLoop (view source)
  7. AddressBook (view source)
  8. Events/Listeners (view source)
  9. try-catch Example: no catch.
  10. try-catch Example: with catch.
Graphics, Animation, and Games ... Oh my!
  1. Basic Graphics: HomerWantDonut (view source)
  2. Basic Animation using Threads: HomerMovement (view source)
  3. Starter Game: AngryHomer (view source)
  4. Game Engine: Raw game engine source: GameEngine.java.
    1. Simple Example (view source)
    2. AngryHomer (view source)
    3. PuttPutt (view source)
  5. Unreal mass/physics engine demo: Shows of 25,000 barrels of oil.
    Click here
    (not mine obviously!).

Examples Built in Lab (By Day)

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

Week 1

  1. TempConverter (TempConverter.java)
  2. Computing Powers (Powers.java)
  1. AddressBook (AddressBook.java)
  2. MinMaxArray (MinMax.java)
  1. Sorting (Sort.java)
  2. Crosshair (Crosshair.java)
  1. Keybindings (Keybindings.java)
  2. Shapes (Shapes.java)

Week 2

To be filled out then...
  1. Shapes (Completed) (Shapes.java)
  1. Zach's ATM (ATM.java)
  2. Zach's other ATMGetNumber (ATMGetNumber.java).
  3. Anaga's Nim (Nim.java).
  1. ThreadAnimation (ThreadAnimation.java)
  1. James's AlarmClock (AlarmClock.java)
  2. Nathan's Game: Circle Madness, Part Deux.

Assignments & Solutions

  1. Eclipse and Java Basics
  2. Control Structures & Arrays
  3. Classes & Methods I
  4. Events
Solutions These are posted after we cover solutions in class.
  1. TempConverter.java, Powers.java.
  2. MaxArray.java, SortArray.java. (Done in class: MinMax.java, Sort.java.)
  3. AddressBookWithAddress.java, PowersMethod.java, Fibonacci.java.
  4. Crosshair.java (Done in class: Crosshair.java, Keybindings.java)

Selected Notes/Hints for Individual Student Projects

Anaga: The Game of Nim.
Anaga wishes to build a Game of Nim with a pyramid of matches up to 16 rows tall.
Information about the game can be found here (Wikipedia).
  • How do you plant to represent each heap internally, and the state of each heap as the game proceeds? (Hint: Could use a simple array of numbers!)
  • How do you plan to display each heap? Graphics would not be too difficult, but perhaps we could start with something simpler at first.
  • Think about the user interface in general... how do you want it to look/behave?
  • UPDATE (TUESDAY): I have posted your sample GUI here: Nim (Nim.java). It contains a few corrections from the version I showed in class today.
Charles: Stock Prediction.
Charles wants to build an application to track stock prices and predict them with custom methods of prediction. If this program works, I, Ryan Flannery, am entitled to 25% of any profit he makes. I am not, however, responsible for any loss.
  • Where do you plan to get the current stock prices from? They need to be accessible in an easy-to-parse format.
  • For an example of the above, see Dr. Franco's example where weather information is obtained from NOAA: Weather.java.
  • It seems like you might want to know not just the current stock prices, but also the history of stock prices. It's easy to obtain the current value and parse that, but building in a history might be a little difficult to do in one week.
    Is obtaining just the current price adequate for your needs?
Christian: Task Manager.
Christian wants to replace the stock Task Manager on Windows.
  • Take a look at Ethan's project from last here, available here (MonitorApplet.java).
  • Checkout the tasklist and systeminfo commands in Windows. To run them, open a command prompt (Start -> Run -> cmd.exe and type those commands). Google for some info. They provide some of the information you're looking for, and they have various options to obtain more detailed information.
  • Ethan's code works by executing those commands and reading their output, and then parsing it to produce some stats in a window. He was working towards a graphical display, but didn't finish it by the end of the second week.
  • I'll note the following: As a UNIX (OpenBSD) user, I fail miserably when it comes to anything Windows related. I'll try to help, and hopefully the TA's will be able to provide more insight (I believe they are all Windows users).
Elijah: Connect 4.
Elijah wishes to build a Connect 4 games. For information about the game, click here.
  • Think about your user interface. How do you want it to look? Keep it simple to start with!
  • How do you plan to represent the state of the board?
  • Your representation must account for the following:
    1. Tne normal board is 7 circles wide, 6 location hight
    2. Must account for empty locations
    3. Must distinguish filled location between the two colors
  • A simple array could be used to represent the board...can you see how?
  • When each user has a turn, they only need to specify a column
  • NOTE: it must be an empty column!
Eric: Helicopter.
Eric wants to build a 2D side-scrolling Helicopter game.
  • How do you plan to represent a board? Let's not do a dynamic/random board, but rather just one fixed board.
  • You could use an array of strings to specify the empty/filled in areas of a long board... can you see how?
  • Let's not worry about angled/rounded edges, but rather just work with fixed squares that are either empty or “rock”.
  • likewise, the helicopter could be just a single square of a different color (to start with).
I'll explain more of this in lab.
Grant: Political Game.
Grant wants to write a game where you can throw money at hungry politicians.
  • Grant: I think you're game has a great chance of being complete by the end of the week, and quite nice...
  • ...provided you're willing to put in the work!
  • I would highly recommend paying attention to the Shapes examples we covered in class on Friday of week 1 and Monday of week 2.
  • The Angry Homer example will also be of value, but wait until Tuesday of Week 2 to look at that.
  • Between the Shapes example and Angry Homer, you have everything you need! Work on understanding those examples!
Hayden: Guitar Hero.
Hayden would like to build a simple Guitar Hero game.
  • The user interface mockup you sent me is great. It's simple, and I think we can easily get it working.
  • The only big part you need to think about is the following...
  • How do you plan to represent the incoming sequence of notes?
  • As we talked about, an array of Strings could easily be used for this.
  • Once you have that, how do you think you could animate that sequence of notes? (Hint: think, one row of the array per second, or something similar)
  • You'll need to use threads for this, but it shouldn't be very complicated.
Heath: Instant Messenger.
Heath would like to build an instant messenger.
  • Prof. Franco has an example of this on his website here.
  • Obviously, you don't want to copy/paste his stuff, but you can use it as a starting point.
  • Note the following about his code:
    1. There are two Java programs
    2. One is the server, the other is the client.
    3. First understand why he has both... we'll work on this in lab together.
  • The key thing I think you can get out of this project is understanding the basics of internet communication....
  • ...This is great stuff to know!
Hee: Peg Game.
Hee wants to build a Peg-game... I can't find the name of it, but it's the same game they have at Cracker Barrel, if you're familiar with that.
  • I think this will be a fun game, and I think you'll have a great chance of completing it by the end of this week.
  • Think about your user interface... how do you want it to look?
  • For now, try to keep it as simple as possible (you can always make it better later)
  • How do you plan to represent the state of the board? It needs to take into account the following:
    1. A triangle of “size” 6, each a location for a peg.
    2. Need to be able to tell if each location has a peg or does not have a peg.
  • A simple array could be used for this... can you see how?
  • Given a representation of the board, how do you want users to specify a move?
  • You need to be able to determine if a move is valid, given your representation of the board and the move the user specified!
James: Alarm Clock.
James would like to build an alarm clock application that plays a custom song at a given time.
Music file: here.
Nathan: Networking for Multiplayer Game.
Nathan would like to learn the basics of how to maintain the state of a game between multiple computers for multiplayer gaming.
Nils: Tower Defense.
Nils isn't content with most Tower Defense style games, and wishes to make an awesome one.
: Chess Player.
Taylor: Bejeweled.
Taylor would like to build a Bejweled-style game.
Tina would like to build a Snake-like game.
  • Tina is already well-on-her way, though I recommend the following:
    1. Start with just colored squares, as you have been doing so far.
    2. We can add graphics/images later on, quite easily.
    3. For now, focus on the logic of the game, and get that right.
    4. Specifically, the “growing” of the snake, how it moves, and starting/ending a game appropriately.
Zach wants to simulate an ATM machine.
  • The interface was a little complicated, so I offered to build it for Zach. Here is the applet, showing how to distinguish betweem multiple buttons: ATM (ATM.java).
  • Now, given the above, how do you plan to track the state of the ATM? Let me talk with you about this further, and don't look at the next example before we talk....
  • ATM with simple state tracking: ATMGetNumber (ATMGetNumber.java).

Showcase of Student Projects

To be filled out during the second week.

These images shamelessly copied from here.