import java.awt.*;
import javax.swing.*;

        // Display a central OvalCanvas and a descriptive Label.
public class SwingOvalApplet extends JApplet {
    public void init(){
        final Container contents = getContentPane();
        // Use a BorderLayout rather than the default FlowLayout.
        contents.setLayout(new BorderLayout());
        // Add a label at the top.
        contents.add(new JLabel("A Swing Oval JApplet",JLabel.CENTER),
                     "North");

        // An an oval-drawing canvas.
        Component c = new OvalCanvas();
        // Give the canvas half the extent of this applet.
        Dimension size = getSize();
        c.setSize(size.width/2,size.height/2);
        contents.add(c,"Center");
    }
}
