title: JFrame background color not working
body: <p><strong>My code</strong></p>
  
  <pre><code>public static void main(String[] args) throws InterruptedException {
      JFrame frame = new JFrame("Flappy bird");
      frame.setSize(1200, 800);
      FlappyBird game = new FlappyBird();
      frame.getContentPane().setBackground(Color.YELLOW);
      frame.add(game);
      frame.setVisible(true);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
      frame.setResizable(false);
      while (true) {
              game.moveBall();
              game.gameOver();
              game.moveRect();
              game.repaint();
              Thread.sleep(14);
          }
  
  }
  </code></pre>
  
  <p>Why isn't the <code>frame.getContentPane().setBackground(Color.YELLOW);</code> working?</p>
  
  <p>I've tried to rearrange the order, like setting the color after making the frame visible.</p>