import java.awt.*;

    // Repeatedly request a canvas to paint itself.
public class MovingArcFrame extends Frame {
    public MovingArcFrame(){
        // Set the frame's size.
        final int width = 200, height = 200;
        setSize(width,height);
        setBackground(Color.white);

        add(getCanvas());
    }

    public void run(){
        // Animate the drawing 30 times per second.
        final int sleepTime = 1000/30;
        MovingArcCanvas canvas = getCanvas();

        while(true){
            try{
                Thread.sleep(sleepTime);
                // Perform the next animation step.
                canvas.step();
            }
            catch(InterruptedException e){
            }
        }
    }

    protected MovingArcCanvas getCanvas(){
        return animationCanvas;
    }

    private MovingArcCanvas animationCanvas = new MovingArcCanvas();
}

