Basic HTML version of Foils prepared 13 July 98

Foil 52 Another Polygon Constructor

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


Here's another way to instantiate a polygon: int xValues = { 25, 125, 125, 25 }; int yValues = { 25, 25, 75, 75 }; Polygon p = new Polygon( xValues, yValues, 4 );
To fill this quadrilateral, type: g.fillPolygon( p );
Note: The number of vertices is required in this version of the Polygon constructor



© 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 Fri Jul 24 1998