Section 13.7 Drawing Polygons and Polylines
• Class Polygon
contains methods for creating polygons.
• Polygons are closed multisided shapes composed of straight-line segments.
• Polylines (p. 578) are sequences of connected points.
• Graphics
method drawPolyline
(p. 580) displays a series of connected lines.
• Graphics
methods drawPolygon
(p. 580) and fillPolygon
(p. 581) are used to draw polygons.
• Polygon
method addPoint
(p. 581) adds pairs of x- and y-coordinates to the Polygon
.
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.