Momo
Momo

Reputation: 2491

Draw an open Polygon in Java

I'm trying to draw an open rectangle using a Polygon:

int[] xPoints = {1,1,3,3};
int[] xPoints = {0,5,5,0};
polygone = new Polygon(xPoints, yPoints, 4);
g2d.draw(polygone);

Is there any way to have an open Polygon?

Upvotes: 1

Views: 2116

Answers (1)

trashgod
trashgod

Reputation: 205785

You might look at java.awt.geom.Path2D, used here, or java.awt.geom.GeneralPath, illustrated here.

Upvotes: 1

Related Questions