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.

Two triangles, one closed one not

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 | Cafe au Lait

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