title: Simple 2D Java Game
body: <p>I'm trying to create a java game in which balls randomly drop from the top of the screen and we need to catch the balls using a catcher which is located at the bottom of the screen.</p>
  
  <p>I'm having a difficult time figuring out how to actually draw this onto my JFrame.</p>
  
  <p>I've got a class for my 'catcher', 'ball', 'game space' and I would like to put it all together.</p>
  
  <p>How do I draw my 'catcher' onto my screen?</p>
  
  <p>Currently, I have a 'Game' class which looks like this.</p>
  
  <pre><code>public class Game extends JFrame implements KeyListener {
  
  GameScreen gameScreen;
  Catcher playerOneCatcher;
  
  public static void main (String[] args) {
      new Game();
  }
  
  public Game() {
  
      super("CATCH");
      setSize(640,480);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setVisible(true);
      setLocationRelativeTo(null);
      setResizable(false);
      addKeyListener(this);
  
  
      this.gameScreen = new GameScreen();
      this.playerOneCatcher = new Catcher(40, 10); 
  
  
  }
  </code></pre>
  
  <p>I've tried something like this in my Catcher class...</p>
  
  <pre><code>public void paintComponent(Graphics g) {
      g.setColor(Color.BLUE);
      g.fillRect(positionX, positionY, this.width, this.height);
  }
  </code></pre>
  
  <p>However, its not showing on my screen. </p>
  
  <p>Any help would be greatly appreciated.</p>