title: I have no idea what I'm doing - Paint Methods, etc
body: <p>I have been struggling with Paint methods, and paint components, and extends JFrame, and have been trying all sorts of ways to get a simple rectangle to draw. here is a class called Window:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.Graphics;
  
  public class Window extends JFrame 
  {
      /**
       * 
       */
      private static final long serialVersionUID = 1L;
      Window()
      {
          setSize(300,300);
          setVisible(true);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
      }
      public void paint(Graphics g)
      {
          g.drawRect(300,300,300,300);
      }
  }
  </code></pre>
  
  <p>then class Main</p>
  
  <pre><code>public class Main {
  
          public static void main(String args[])
          {
              Window mainWindow = new Window();
              mainWindow.setBounds(100,100,300,300);
          }
  }
  </code></pre>
  
  <p>The sole purpose of this program is just draw a damn rectangle. I have no idea what I could be doing wrong, and I have been trying to drawRect or drawString for several days now, to no avail. I also tried with a panel.</p>