public void actionPerformed(ActionEvent ae){
  long currentTime=System.nanoTime() / 1000000;
  long totalTime=currentTime - cycleStart;
  if (totalTime > CYCLE_TIME) {
    cycleStart=currentTime;
  }
  float fraction=(float)totalTime / CYCLE_TIME;
  fraction=Math.min(1.0f,fraction);
  fraction=1 - Math.abs(1 - (2 * fraction));
  animate(fraction);
}

public void actionPerformed ( ActionEvent ae ) { long currentTime = System . nanoTime ( ) / 1000000 ; long totalTime = currentTime - cycleStart ; if ( totalTime > CYCLE_TIME ) { cycleStart = currentTime ; } float fraction = ( float ) totalTime / CYCLE_TIME ; fraction = Math . min ( 1.0f , fraction ) ; fraction = 1 - Math . abs ( 1 - ( 2 * fraction ) ) ; animate ( fraction ) ; }
this method handles the events from the swing timer
