If I was using a JFrame, I'd liberally throw in a few pack() statements, which causes the JFrame to resize itself based on the new components, and redraw, but you don't have this option with an applet. After some javadocing, it seems that a combination of validate(), invalidate() and repaint() ought to do it. Some experiments later, it seems that
- invalidate does nothing
- validate shows up the new components, but over the old ones
- repaint erases everything
- invalidate followed by validate is the same as validate
- invalidate followed by repaint is the same as repaint
- validate followed by repaint does the trick