1

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?

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
Momo
  • 2,471
  • 5
  • 31
  • 52

1 Answers1

1

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

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045