title: Program to 'Change color of a circle on click doesn't Compile
body: <p>I'm Learning GUI in  Java from "Head First Java"
  When I wrote the following Program I can't figure out where I have gone wrong even after 
  debugging for over 20 minutes .</p>
  
  <pre><code>import javax.swing.*;//for the frame etc
  import java.awt.*;//for  paintComponent(),Grapics Object etc
  import java.awt.event.*;//for listeners
  
  
  //display a circle and chang eits color when a button is clicked
  
  class MyDrawPanel extends JPanel//this class will contain code for the circle
  {
  
      public void paintComponent(Graphics g)
      {
      int r=(int)(Math.random()*255);//generate random float between 0 &amp; 255
      int b=(int)(Math.random()*255);//generate random float between 0 &amp; 255
      int gr=(int)(Math.random()*255);//generate random float between 0 &amp; 255
      Color randcolor=new Color(r,gr,b);//name clashed with Graphics g
      g.setColor(randcolor);
      g.fillOval(90,90,120,120);//default background color is used,oval is filled with Color (randcolor);
      }
  }
  
  public class changecolor implements ActionListener
  {
  
  JButton button;//ie this class's objects have a button as an instance field
  MyDrawPanel p;//similar except this isuser defined
  
      public static void main(String args[])
      {
      changecolor c=new changecolor();
      c.go();
      }
  
      public void go()
      {
      button=new JButton("Change Color ");
      button.addActionListener(this);//this class ie object of this class listens to                       the action
      p=new MyDrawPanel();
      JFrame frame=new JFrame();
      frame.setSize(700,700);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.getContentPane().add(BorderLayout.SOUTH,button);
      frame.getContentPane().add(BorderLayout.CENTRE,p);
      frame.setVisible(true);
      }
  
      public void actionPerformed(ActionEvent e)
      {
      frame.repaint();//repaint or referesh the frame;
  
      }
  
  
  }
  </code></pre>
  
  <p>I get these Errors</p>
  
  <pre><code>  changecolor.java:49: error: cannot find symbol
      frame.repaint();//repaint or referesh the frame;
      ^
    symbol:   variable frame
    location: class changecolor
  1 error
  </code></pre>
  
  <p>I know i missed something trivial ,can someone please tell me what I missed ?, Thanks you !.</p>