The problem: DrawPad.java and RecursiveTree.java do not paint well. To see this, just draw a few shapes then minimize the window and restore it. The shapes are gone! Compare this to Checkers.java (Java 5.0), which can be minimized and restored with the same state painted in all cases. What is the difference? Issues of painting are somewhat obfuscated in Java. The following references, while not concise, do clarify some of the issues and paint some solutions to the problem.

Performing Custom Painting

Solving Common Painting Problems

Performing Custom Painting -Answers

JComponent Class

Passive vs. Active Rendering

Double Buffering and Page Flipping

Supporting User Interaction  (look at the example SwingShapeMover.java)