62,614
社区成员
发帖
与我相关
我的任务
分享
class PolygonsPanel extends JPanel{
protected void paintComponent(Graphics g){
super.paintComponent(g);
}
int xCenter=getWidth()/2;
int yCenter=getHeight()/2;
int radius=(int)(Math.min(getWidth(), getHeight())*0.4);
//创建一个多边形对象
Polygon polygon=new Polygon();
//添加定点到多边形
polygon.addPoint(40,20);
}
class PolygonsPanel extends JPanel{
protected void paintComponent(Graphics g){
super.paintComponent(g);
int xCenter=getWidth()/2;
int yCenter=getHeight()/2;
int radius=(int)(Math.min(getWidth(), getHeight())*0.4);
//创建一个多边形对象
Polygon polygon=new Polygon();
//添加定点到多边形
polygon.addPoint(40,20);
}
}
class PolygonsPanel extends JPanel{
protected void paintComponent(Graphics g){
super.paintComponent(g);
}
int xCenter=getWidth()/2;
int yCenter=getHeight()/2;
int radius=(int)(Math.min(getWidth(), getHeight())*0.4);
//创建一个多边形对象
Polygon polygon=new Polygon();
//添加定点到多边形
polygon.addPoint(40,20);
}