title: Java getContentPane().setBackground() not working
body: <p>Im trying to encapsulate the GUI calls to a single class. My window appears but the background remains the default color instead of red.</p>
  
  <p>ChatProgram.java</p>
  
  <pre><code>package ChatPkg;
  
  public class ChatProgram {
  
      /**
       * Launch the application.
       */
      public static void main(String[] args) {
  
          ChatWindow.initialize();
          ChatWindow.RunWindow();
  
      }
  
  }
  </code></pre>
  
  <p>ChatWindow.java</p>
  
  <pre><code>package ChatPkg;
  
  import java.awt.BorderLayout;
  import java.awt.Color;
  import java.awt.EventQueue;
  
  import javax.swing.JCheckBox;
  import javax.swing.JFrame;
  import javax.swing.JList;
  import javax.swing.ListSelectionModel;
  
  public final class ChatWindow {
  
      static JFrame frame;
  
      /**
       * Create the application.
       */
      private ChatWindow() { }
  
      public static void RunWindow() {
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      frame.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  
      /**
       * Initialize the contents of the frame.
       */
      public static void initialize() {
          frame = new JFrame("Chat program");
          frame.setBounds(100, 100, 450, 450);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          JCheckBox chckbxCvbc = new JCheckBox("cvbc");
          frame.getContentPane().add(chckbxCvbc);
  
          // Set background color
          frame.getContentPane().setBackground(Color.red);
      }
  
  }
  </code></pre>
  
  <p>Yes i am new to Java and none of the google results solved my problem.</p>