import java.awt.*;

    // Repeatedly request a canvas to paint itself.
class BufferedArcFrame extends Frame {
    public BufferedArcFrame(){
        // 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 50 times per second.
        final int sleepTime = 1000/50;
        DoubleBufferCanvas canvas = getCanvas();

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

    protected DoubleBufferCanvas getCanvas(){
        return animationCanvas;
    }

    private DoubleBufferCanvas animationCanvas = new DoubleBufferCanvas();
}
