protected void paintComponent(Graphics g){
super.paintComponent(g);//调用父类的方法清空
Color c = g.getColor();
g.setColor(Color.red);
g.fillOval(x, y, 30, 30);
g.setColor(c);
x += 5; //改变坦克坐标,实现移动效果
}
请大家帮忙解释下这段代码
super.paintComponent(g);//调用父类的方法清空
Color c = g.getColor();
g.setColor(Color.red);
g.fillOval(x, y, 30, 30);
g.setColor(c);
x += 5; //改变坦克坐标,实现移动效果
}
请大家帮忙解释下这段代码
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货