Suppose we wanted to move a square across the applet window: public void paint( Graphics g ) { // Move and fill the square: square.translate( 1, 1 ); square.fill( g ); } |
The problem is: Eventually, the square will move off the applet window and never return! |