请问怎么用java画一个三角形?最好是RoundTriangle,谢谢 请问怎么用java画一个三角形?最好是RoundTriangle,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //画三角形 public void drawTriangle(Graphics g,Color color,int x1,int y1,int x2,int y2,int x3,int y3) { Polygon filledPolygon=new Polygon(); filledPolygon.addPoint(x1,y1); filledPolygon.addPoint(x2,y2); filledPolygon.addPoint(x3,y3); g.setColor(color); g.drawPolygon(filledPolygon); } //画三角形1 public void drawTriangle(Graphics g,Color color,Point p1,Point p2,Point p3) { Polygon filledPolygon=new Polygon(); filledPolygon.addPoint(p1.x,p1.y); filledPolygon.addPoint(p2.x,p2.y); filledPolygon.addPoint(p3.x,p3.y); g.setColor(color); g.drawPolygon(filledPolygon);} 你自己再思考一下 圆三角? jackkui(键 之 舞 者) 方法应该可行 Java中沙箱的问题(沙箱对非java语言程序的限制问题) 请教一个问题 帮忙看看,谢谢 在Java中怎么使用断言 急!!!jsp问题 麻烦帮忙,关于thinking in java 4th source code 如何执行BAT文件?别告诉我Runtime.getRuntime().exec(“x.bat”),它根本不行。 java如何转换图片格式,高分求助,急!! 关于thinking in java 2 中的com.bruceeckel包在那能找到?? 在GUI中,如何遍歷一個窗體中的所有物件 如何获取某字符串? 在一个textField内输入值另一个textField值实时改变
public void drawTriangle(Graphics g,Color color,int x1,int y1,int x2,int y2,int x3,int y3)
{ Polygon filledPolygon=new Polygon();
filledPolygon.addPoint(x1,y1);
filledPolygon.addPoint(x2,y2);
filledPolygon.addPoint(x3,y3);
g.setColor(color);
g.drawPolygon(filledPolygon); } //画三角形1
public void drawTriangle(Graphics g,Color color,Point p1,Point p2,Point p3)
{ Polygon filledPolygon=new Polygon();
filledPolygon.addPoint(p1.x,p1.y);
filledPolygon.addPoint(p2.x,p2.y);
filledPolygon.addPoint(p3.x,p3.y);
g.setColor(color);
g.drawPolygon(filledPolygon);}
你自己再思考一下