Difference between revisions of "Playpen"

From Progzoo
Jump to: navigation, search
(Polygon)
(Polygon)
Line 21: Line 21:
 
   Polygon tri = new Polygon();
 
   Polygon tri = new Polygon();
 
   tri.addPoint(10,50);
 
   tri.addPoint(10,50);
   tri.addPoint(50,10);
+
   tri.addPoint(50,10);//
 
   tri.addPoint(50,90);
 
   tri.addPoint(50,90);
 
   g.drawPolygon(tri);
 
   g.drawPolygon(tri);

Revision as of 13:04, 18 November 2007

A polygon is an angular shape such as a triangle or a hexagon. We need tto specify a whole list of points to draw or fill a polygon.

Polygon

<img src="/img/drawPoly.png" style="float:left;border-width:thin;border-style:solid"/>


The Polygon object may have a number of Points added.


[Font] [Default] [Show] [Resize] [History] [Profile]