From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. byNancy McCracken (foils by Tom Scavo)
The java.awt.Polygon class is used to represent arbitrary polygons: Polygon p = new Polygon(); p.addPoint( 50, 25 ); p.addPoint( 75, 100 ); p.addPoint( 25, 100 );
The above triangle is drawn like this: g.drawPolygon( p );