title: java swing setting frame background color not working
body: <p>I am trying to create a tic tac toe game using java swing. I created a frame and set its background to a color. The problem is that the background color of the frame is not changing, I tried using other colors but the background color is always white.
  here is the code:</p>
  <pre><code>public class TicTacToe implements ActionListener {
      Random random = new Random();
      JFrame frame = new JFrame();
      JPanel title_panel = new JPanel();
      JPanel button_panel = new JPanel();
      JLabel textField = new JLabel();
      JButton[] button = new JButton[9];
      boolean player1_turn;
  
      TicTacToe () {
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(800,800);
          frame.setVisible(true);
          frame.setTitle(&quot;Tic Tac Toe&quot;);
          frame.setLayout(new BorderLayout());
          frame.getContentPane().setBackground(Color.BLACK);
  
  
          textField.setBackground(new Color(0x084887));
          textField.setForeground(new Color(0xF58A07));
          textField.setText(&quot;Tic-Tac-Toe&quot;);
          textField.setFont(new Font(&quot;Ink Free&quot;,Font.BOLD,75));
          textField.setOpaque(true);
          textField.setHorizontalAlignment(JLabel.CENTER);
  
  
          title_panel.setLayout(new BorderLayout());
          title_panel.setBounds(0,0,800,100);
  
  
          title_panel.add(textField, BorderLayout.NORTH);
          frame.add(title_panel);
      }
  }
  </code></pre>