title: JFrame background color won't change?
body: <p>So, I'm trying to display a simple JFrame but I'm unable to change the background color? Did a few searches and they all suggest to use useContentPane which I have.</p>
  
  <pre><code> import java.awt.*;
  
  import javax.swing.*; 
  
  
  public class Login {
  
       public static void main(String[] args) {
  
           createWindow();
  
           } 
  
      private static void createWindow() {
          JFrame frame = new JFrame("Login System");
          frame.getContentPane().setBackground(Color.darkGray);
          frame.setSize(350, 350);    
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JTextField username = new JTextField();
          frame.add(username);
          frame.setVisible(true);
      }
  
  
  }
  </code></pre>
  
  <p>The JFrame size works but the background does not and the TextField does not, pretty new to this. Any ideas? All help is appreciated.</p>