title: JComponent not appearing
body: <p>I'm trying to create a super simple component, and it's not appearing.</p>
  <p>Component class:</p>
  <pre><code>import java.awt.Color;
  import java.awt.Graphics;
  
  import javax.swing.JComponent;
  
  public class Player extends JComponent{
      
      public Player() 
      {
      
      }
     
      public void paint(Graphics g)
      {  
          g.setColor(Color.green);  
          g.fillRect(40,40,150,150);  
      }  
  
     
  }
  </code></pre>
  <p>Panel Class im adding it to:</p>
  <pre><code>import java.awt.Color;
  import java.awt.Dimension;
  import java.awt.Rectangle;
  
  import javax.swing.JPanel;
  
  public class Game extends JPanel{
  
      public Game() 
      {
          this.setBackground(Color.yellow);
          this.setPreferredSize(new Dimension(500,500));
          Player p = new Player();
          
          this.add(p);
          
      }
      
  }
  </code></pre>
  <p>And the JFrame:</p>
  <pre><code>import javax.swing.JFrame;
  
  public class Launcher {
  
      public static void main(String[] args) {
          
          JFrame frame = new JFrame(&quot;Key Collector Demo&quot;);
          
          frame.add(new Game());
          frame.pack();
          
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
          frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
          
      }
  
  }
  </code></pre>
  <p>The only thing showing up is the yellow background.
  JFrame and JPanel are working fine; this problem consistently happens to me when building jcomponents. What am I missing?</p>
  <p>Any help would be greatly appreciated!</p>