public void actionPerformed(ActionEvent e){
  if (ADJUSTTIMER) {
    long time=System.currentTimeMillis();
    if (lastCall > 0) {
      int nextDelay=(int)(previousDelay - time + lastCall + getRepaintInterval());
      if (nextDelay < MINIMUM_DELAY) {
        nextDelay=MINIMUM_DELAY;
      }
      timer.setInitialDelay(nextDelay);
      previousDelay=nextDelay;
    }
    timer.start();
    lastCall=time;
  }
  incrementAnimationIndex();
}

public void actionPerformed ( ActionEvent e ) { if ( ADJUSTTIMER ) { long time = System . currentTimeMillis ( ) ; if ( lastCall > 0 ) { int nextDelay = ( int ) ( previousDelay - time + lastCall + getRepaintInterval ( ) ) ; if ( nextDelay < MINIMUM_DELAY ) { nextDelay = MINIMUM_DELAY ; } timer . setInitialDelay ( nextDelay ) ; previousDelay = nextDelay ; } timer . start ( ) ; lastCall = time ; } incrementAnimationIndex ( ) ; }
reacts to the timer ' s action events .
