Clearing the Applet
Let’s examine update(…) more closely…
Given a Graphics object g, the following code fragment clears the applet window:int w = getSize().width;int h = getSize().height;g.setColor( getBackground() ); g.fillRect( 0, 0, w, h );g.setColor( getForeground() );