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