title: paintComponent(); is not working/ being called
body: <p>here is my code. and i a little new to coding so please exsplan a lot.</p>
  
  <pre><code>public class main extends JPanel{
  
  
      public static Window f = new Window();
          public static int Width = 600;
          public static int Hight = 400;
          public static void main(String args[]){ 
  
              f.setSize(Width, Hight);
              f.setVisible(true);
              f.setResizable(false);
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.setTitle("FightForYourLife");
              f.setLocationRelativeTo(null);
          }
  
          public void main(){
              JPanel panel = this;
          }
  
          public void paintComponent(Graphics g){
              super.paintComponent(g);
              g.setColor(Color.RED);
              g.fillRect(100, 100, 50, 30);
              System.out.println("IT IS PAINTING");
          }
  
  
  
  }
  </code></pre>