Polylines

Java automatically closes the polygons it draws. That is it draws polygons that look like the one on the right rather than the one on the left.

If you don't want your polygons to be closed, you can draw a polyline instead with the Graphics class's drawPolyline() method

public abstract void drawPolyline(int xPoints[], int yPoints[], int nPoints)

Previous | Next | Top
Last Modified November 4, 1997
Copyright 1997 Elliotte Rusty Harold
elharo@metalab.unc.edu