当尝试使用Java Graphics2D
通过使用点并输入坐标来绘制箭头时。
g2.drawLine(xLeft+290, yTop + 80, xLeft+290,yTop + 100); //first arrow
Polygon arrowHead = new Polygon();
arrowHead.addPoint(xLeft+290, yTop+140);//firstpoint
arrowHead.addPoint(xLeft+285, yTop+120);//secondpoint
arrowHead.addPoint(xLeft+295, yTop+120);//thirdpoint
g2.fillPolygon(arrowHead);
这是我绘制线条和箭头的代码,我不确定所有坐标是否正确,但是如果它不出现,我看不到形状。