Basic HTML version of Foils prepared 13 July 98

Foil 75 Boundary Checking

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


1 Here is a better approach: int dx = 1, dy = 1; public void paint( Graphics g ) { checkBounds( this.getBounds() ); square.translate( dx, dy ); square.fill( g ); }
2 The checkBounds(...) method reverses the direction of motion, if necessary...

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