i have some code that creates a jframe but and changes the backgroun color but when i run it, it doesn't change the background color. The code is below.
public static void main(String[] args) {
mainComponent game = new mainComponent();
JFrame frame = new JFrame(TITLE);
frame.pack();
frame.add(game);
frame.setVisible(true);
frame.setResizable(false);
frame.setSize(WIDTH, HEIGHT);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.getContentPane().setBackground(Color.RED);
}
Any ideas?