这是部分代码public void run(){try{for (int i = 1; i <= STEPS; i++){ball.move(component.getBounds());component.repaint();Thread.sleep(DELAY);}}catch (InterruptedException e){}}
延迟,这样可以看到小球滚动效果
加上延迟,否则变化太快你看它嗖就过去了