标签: java 2d polygon graphic
我尝试使用Polygon绘制一个开放的矩形:
int[] xPoints = {1,1,3,3}; int[] xPoints = {0,5,5,0}; polygone = new Polygon(xPoints, yPoints, 4); g2d.draw(polygone);
有没有办法打开Polygon?
答案 0 :(得分:1)
您可以查看java.awt.geom.Path2D,使用here或java.awt.geom.GeneralPath,图示为here。
java.awt.geom.Path2D
java.awt.geom.GeneralPath