Basic HTML version of Foils prepared 13 July 98

Foil 24 Storing and Accessing Colors

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

The ColorBoxes3 Applet
Colors can be stored in an array: Color color[] = { Color.black, Color.blue, Color.cyan, Color.darkGray };
This array might be used in a loop: int n = color.length; for ( int i = 0; i < n; i++ ) { g.setColor( color[i] ); ... }



© 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