public AnimatedGraphics(){
  Timer timer=new Timer(30,this);
  timer.setInitialDelay(1000);
  animStartTime=1000 + System.nanoTime() / 1000000;
  timer.start();
}

public AnimatedGraphics ( ) { Timer timer = new Timer ( 30 , this ) ; timer . setInitialDelay ( 1000 ) ; animStartTime = 1000 + System . nanoTime ( ) / 1000000 ; timer . start ( ) ; }
set up and start the timer
