title: why paint method not being called in snake game
body: <pre><code>@SuppressWarnings("serial")
  class GUI extends JPanel implements ActionListener
  {
  
      public void paint(Graphics g)
      {
          super.paint(g);
          System.out.println("In here...");
          g.drawRect(frame.getWidth()/2,frame.getHeight()/2,(frame.getWidth()/2)+5,(frame.getHeight()/2+5));
          g.setColor(Color.BLACK);
          g.fillRect(frame.getWidth()/2,frame.getHeight()/2,(frame.getWidth()/2)+5,(frame.getHeight()/2+5));
      }
  
      @Override
      public void actionPerformed(ActionEvent ae) 
      {
          if(ae.getSource() == slow)
          {
              this.setMotionToSnake(slowMotion);  
              this.repaint();
          }
  
  }
  }
  </code></pre>
  
  <p>Im writing a snake game program. While doing that paint method is not being called. 
  Explaining the code: 
  im adding one menu bar to my frame 
  in that menu bar start is one menu with 3 sub menus in it viz slow,medium,fast.
  Whenever i say slow the motion of the snake to move is decided and now i should able to see a rectangular box(at least) in the frame.
  Thats why im calling the repaint method there.</p>
  
  <p>Other than this.repaint() i have also used frame.repaint() / just repaint().
  But method is not getting invoked.</p>
  
  <p>Thanks for ur help in advanced.</p>