title: Draw Rectangle in JFrame not working
body: <p>I have this bit of code that's supposed to draw a rectangle on a <code>JFrame</code> but when I run the program on Eclipse, it just opens the frame, but does not draw the circle on it. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  
  public class Infout {
      Infout(){
          JFrame frame = new JFrame();
  
          frame.setSize(300, 400);
          frame.setTitle("An Empty Frame");
          frame.setDefaultCloseOperation(3);
  
          frame.setVisible(true);
      }
  
      public static void main(String[] args) {
           // TODO Auto-generated method stub
           Infout m = new Infout();
           m.paint(null); 
      }
  
      public void paint(Graphics g) 
      {
           g.drawRect(5, 5, 105, 105);
      }
  }
  </code></pre>
  
  <p>Can someone please tell me why it's not working properly? </p>