幸运 @Override public void mouseExited(MouseEvent e) { if(state==RUNNING) { state=PAUSE; } } @Override public void mouseEntered(MouseEvent e) { if(state==PAUSE) { state=RUNNING; } } }; this.addMouseMotionListener(l); this.addMouseListener(l); Timer timer=new Timer(); timer.schedule(new TimerTask() { private int runTimes=0; @Override public void run() { if(state==RUNNING) { runTimes++; if(runTimes%40==0) { nextOne(); } for(int i=0;i