src/SpinningKartJPanel.java
public void startAnimation()
    {
        if ( animationTimer == null )
        {
            currentImage = 0; // display first image
            
            // Create timer
            animationTimer = new Timer ( ANIMATION_DELAY, new TimerHandler() );
            
            animationTimer.start(); // start Timer
        } // end if statement
        else // animationTimer already exists, restart animation
        {
            if ( ! animationTimer.isRunning() )
                animationTimer.restart();
        } // end else statement
    }
// Start animation, or restart if window is redisplayed
Start animation, or restart if window is redisplayed
Start animation or restart if window is redisplayed
public void startAnimation()
    {
        if ( animationTimer == null )
        {
            currentImage = 0; 
            animationTimer = new Timer ( ANIMATION_DELAY, new TimerHandler() );
            animationTimer.start(); 
        } 
        else 
        {
            if ( ! animationTimer.isRunning() )
                animationTimer.restart();
        } 
    }
public void startAnimation ( ) { if ( animationTimer == null ) { currentImage = 0 ; animationTimer = new Timer ( ANIMATION_DELAY , new TimerHandler ( ) ) ; animationTimer . start ( ) ; } else { if ( ! animationTimer . isRunning ( ) ) animationTimer . restart ( ) ; } }
Start animation, or restart if window is redisplayed
Start animation or restart if window is redisplayed
// display first image // Create timer // start Timer // end if statement // animationTimer already exists, restart animation // end else statement