title: java.awt.Shape is playing tricks on me
body: <p>![enter image description here][1]I'm in my first year of Java programming at school and I'm looking ahead in my book a little bit.  I've come across a class (called <code>Canvas</code>) that has a <code>draw(Shape shape)</code> method.  </p>
  
  <p>For some reason I can't figure out how to get any shapes to draw onto the canvas.  I've searched through the Java API and I can't get the syntax right. I'm pissed off because I know its something super simple. Any help would be greatly appreciated.</p>
  
  <p>Here is the code for the method that I'm stuck with: </p>
  
  <pre><code>/**
   * Draw the outline of a given shape onto the canvas.
   * @param  shape  the shape object to be drawn on the canvas
   */
  public void draw(Shape shape)
  {
      graphic.draw(shape);
      canvas.repaint();
  }
  </code></pre>
  
  <p>When I call the method from the object it gives me something like this:</p>
  
  <pre><code>canvas1.draw(-&gt;Shape shape&lt;-)
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>java.awt.Shape circle
  java.awt.Shape Circle
  Circle circle
  Shape circle
  </code></pre>
  
  <p>The list goes on forever.</p>
  
  <p>EDIT:</p>
  
  <p>here's the meat and potatoes of the class... pretty straightfoward stuff</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.geom.*;
  
  /**
   * Class Canvas - a class to allow for simple graphical 
   * drawing on a canvas.
   * 
   * @author Michael Kölling (mik)
   * @author Bruce Quig
   *
   * @version 2011.07.31
   */
  
  public class Canvas
  {
      private JFrame frame;
      private CanvasPane canvas;
      private Graphics2D graphic;
      private Color backgroundColor;
      private Image canvasImage;
  
      /**
       * Create a Canvas with default height, width and background color 
       * (300, 300, white).
       * @param title  title to appear in Canvas Frame     
       */
      public Canvas(String title)
      {
          this(title, 300, 300, Color.white);
      }
  
      /**
       * Create a Canvas with default background color (white).
       * @param title  title to appear in Canvas Frame
       * @param width  the desired width for the canvas
       * @param height  the desired height for the canvas
       */
      public Canvas(String title, int width, int height)
      {
          this(title, width, height, Color.white);
      }
  
      /**
       * Create a Canvas.
       * @param title  title to appear in Canvas Frame
       * @param width  the desired width for the canvas
       * @param height  the desired height for the canvas
       * @param bgClour  the desired background color of the canvas
       */
      public Canvas(String title, int width, int height, Color bgColor)
      {
          frame = new JFrame();
          canvas = new CanvasPane();
          frame.setContentPane(canvas);
          frame.setTitle(title);
          canvas.setPreferredSize(new Dimension(width, height));
          backgroundColor = bgColor;
          frame.pack();
          setVisible(true);
  </code></pre>
  
  <p>-- If I had enough rep to post a screen shot I would have --</p>