15-120 Intro to OOP for Business Spring 2000
Lab 13 - revised to become
A Very Short Lab with Threads...
Due Date: Monday April 24, 2000 at 8:00 am

The Basic Version (Jim's Solution)
The Bonus Version (Jim's Solution)

Assignment:
Finish the animation code in the Lab13.java file. All of the code is there except the body of the paint( ) method. When you are finished, the monogram should "fall" down to the bottom of the applet window and jump instantly back to the top of the window to fall again. There can never be any partial monograms in the applet window - that will result in a grade of 0%

Bonus: For an extra 20% instead of having the monogram jump back to the top, animate it back to the top so it slides up and down.

Background
Everything is here. We want to introduce you to threads but it would be too much to have you slog through all of this so we have hooked up the buttons and wrote the actionPerformed() method for you. All you need to do is fill in the paint( ) method. Here is what you have to do in paint( ) to make this work:
1. erase the previous monogram
2. change the y coordinate of the monogram so it will appear in a new position
3. check the new position to see if the monogram will fit completely on the screen
4. if it does not, change the y coordinate to put the monogram back to the top of the applet 5. draw the new monogram

The bonus is up to you - no help there. Get the basic lab working. Save it and make a copy to do the bonus. If you can't get the bonus to work, you will still have a working program to turn in.
You can get a folder named Lab13Distribution that has the needed files from the handouts folder in the course volume at:
/afs/andrew.cmu.edu/course/15/120/handouts
You should use these forcoding the lab.

Handin
Create a folder named according to the tradition of the first seven labs. Put the .html and .java file into that folder. DO NOT HAND IN THE .class FILE!

FTP your folder to the usual place. Look for a folder marked Lab13.