The purpose of this activity is to learn more about output and automatic redraw. You will need to download http://courses.csail.mit.edu/6.831/handouts/ac6/ac6-code.zip, which contains the Java code you'll be using. If you use Eclipse, you can create a project directly from the ZIP file using File / Import / Existing Projects into Workspace / Select archive file.
Run Problem1.java and click on the window to make the red circle appear. What happens when you move another window over the Problem1 window, then uncover it again? (If you're using a Mac, you'll see different behavior than a Windows user will. Look at a Windows box to see the effect we're interested in.)
Why does this happen? How would you fix it in the code?
Run Problem2.java. Pressing the keyboard arrows should move the circle around the window. What happens? Why does this happen? How would you fix it in the code?
Open Problem3.java and run it. Clicking on the window should move the circle through a little animation. What actually happens? Why does this happen?
Find the methods of JComponent that are concerned with painting, and write them down with a one-line description of each method. Draw arrows to show which methods call each other. If you need help understanding the Swing painting model, you may want to look at Sun's article Painting in AWT and Swing.