确实清空了,我分着又试了下,但在清空后的下面加慢动作重绘的代码就不清楚了...很邪门
-----------------------------------------------------------------
protected void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
for(Pan pan: lstPoint)
{
g2.setPaint(pan.getColor());
g2.draw(pan.getLine());
try{Thread.sleep(100);}catch(Exception e){e.printStackTrace();}//睡0.1秒画一次
System.out.println("paint内部的代码!");
}
}
红色的都去了,清空没问题,加上后就清空不了了.....而且不停的打印System.out.println("paint内部的代码!");虽然在运行,但看不出重绘的慢动作效果..
-----------------------------------------------------------------
protected void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
for(Pan pan: lstPoint)
{
g2.setPaint(pan.getColor());
g2.draw(pan.getLine());
try{Thread.sleep(100);}catch(Exception e){e.printStackTrace();}//睡0.1秒画一次
System.out.println("paint内部的代码!");
}
}
红色的都去了,清空没问题,加上后就清空不了了.....而且不停的打印System.out.println("paint内部的代码!");虽然在运行,但看不出重绘的慢动作效果..
我在说's blog http://www..cn