Basic HTML version of Foils prepared 13 July 98

Foil 74 MovingSquare.java

From Java Academy II:Advanced Java NPAC/ECS Java Academy -- February to April 98. by Tom Scavo

The MovingSquare Applet
1 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 ); }
2 The problem is: Eventually, the square will move off the applet window and never return!

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998