首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

相干重写JPanel中paintComponent方法,解释

2012-08-08 
有关重写JPanel中paintComponent方法,解释protected void paintComponent(Graphics g){super.paintCompone

有关重写JPanel中paintComponent方法,解释
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;//改变坦克坐标,实现移动效果
}
请大家帮忙解释下这段代码

[解决办法]
几个参数有少许关联性的。。

热点排行