June 2017
Beginner
1296 pages
69h 23m
English
Polygons are closed multisided shapes composed of straight-line segments. Polylines are sequences of connected points. Figure 27.26 discusses methods for drawing polygons and polylines. Some methods require a Polygon object (package java.awt). Class Polygon’s constructors are also described in Fig. 27.26. The application of Figs. 27.27–27.28 draws polygons and polylines.
Graphics methods for polygons and class Polygon methods.| Method | Description |
|---|---|
Graphics methods for drawing polygons |
|
public void drawPolygon(int[] xPoints, int[] yPoints, int points) |
|
Draws a polygon. The x-coordinate of each point is specified in the xPoints array and the y-coordinate of each point in the yPoints array. ... | |