0
我正尝试用单线程移动带有JPanel
中图像的JLabel。如何在面板中移动图标
private void moveBaloon(JLabel Baloon){
for (int i = 0; i < 10; i++) {
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(Bowandarrow.class.getName()).log(Level.SEVERE, null, ex);
}
Point point= Baloon.getLocation();
Baloon.setLocation(point.x, point.y-4);
}
}
5秒钟后气球移动到另一个位置,但它没有视觉移动。我能做些什么来做到这一点?
[如何在Swing中实现“进行中”动画?](http://stackoverflow.com/questions/12206998/how-to-implement-a-in-progress-animation-in-swing ) – 2013-03-22 19:48:39