using eclipse sdk
<p>I made a program to draw shapes and change their colors. I got the reset button to reset to default shapes and colors but can not get it to clear the shapes from the canvas. How do I do that? Here is my code:</p>

<pre><code>// Color Clear choice box
Choice colorChoice;

// the canvas
DrawCanvas canvas;

/**
 * Constructor
 */
public Draw() {
    super("Java Draw");
    setLayout(new BorderLayout());

    // create panel for controls
    Panel topPanel = new Panel(new GridLayout(3, 0));
    add(topPanel, BorderLayout.NORTH);

    // create button control
    Panel buttonPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
    topPanel.add(buttonPanel);

    circle = new Button("Circle");
    buttonPanel.add(circle);
    roundRec = new Button("Rounded Rectangle");
    buttonPanel.add(roundRec);
    threeDRec = new Button("3D Rectangle");
    buttonPanel.add(threeDRec);

    // add button listener
    circle.addActionListener(this);
    roundRec.addActionListener(this);
    threeDRec.addActionListener(this);

    Panel buttonPanel1 = new Panel(new FlowLayout(FlowLayout.LEFT));
    topPanel.add(buttonPanel1);

    lines = new Button("Lines");
    buttonPanel1.add(lines);
    squares = new Button("Square");
    buttonPanel1.add(squares);
    ovals = new Button("Ovals");
    buttonPanel1.add(ovals);

    lines.addActionListener(this);
    squares.addActionListener(this);
    ovals.addActionListener(this);

    // create panel for color choices
    Panel colorPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
    topPanel.add(colorPanel);
    Label label = new Label("Filled Color:");
    colorPanel.add(label);
    colorChoice = new Choice();
    for(int i=0; i&lt;COLOR_NAMES.length; i++) {
        colorChoice.add(COLOR_NAMES[i]);
    }
    colorPanel.add(colorChoice);
    colorChoice.addItemListener(this);

// create reset button
    Button resetButton = new Button("Reset");
    colorPanel.add(resetButton);
    resetButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            colorChoice.select(0);                  // reset color choice box
            canvas.setFilledColor(COLORS[0]);       // reset color used
            canvas.setShape(DrawCanvas.CIRCLE);     // reset shape

        }
    });

// create the canvas
    canvas = new DrawCanvas();
    add(canvas, BorderLayout.CENTER);

}// end of constructor


/**
 *  Implementing ActionListener
 */
public void actionPerformed(ActionEvent event) {
    if(event.getSource() == circle) {  // circle button
        canvas.setShape(DrawCanvas.CIRCLE);
    }
    else if(event.getSource() == roundRec) {  // rounded rectangle button
        canvas.setShape(DrawCanvas.ROUNDED_RECTANGLE);
    }
    else if(event.getSource() == threeDRec) { // 3D rectangle button
        canvas.setShape(DrawCanvas.RECTANGLE_3D);
    }      
}

/**
 * Implementing ItemListener
 */
public void itemStateChanged(ItemEvent event) {
    Color color = COLORS[colorChoice.getSelectedIndex()];
    canvas.setFilledColor(color);
}

/**
 * the main method
 */
public static void main(String[] argv) {
    // Create a frame
    Draw frame = new Draw();
    frame.setSize(WIDTH, HEIGHT);
    frame.setLocation(150, 100);

    // add window closing listener
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent event) {
            System.exit(0);
        }
    });

    // Show the frame
    frame.setVisible(true);
  }
}
</code></pre>
