As the title states, I can't get the background of my JFrame window to change.
I would've bet that just .setBackground(Color.RED) would've worked but no luck. Here's my code:
import javax.swing.JFrame;
import javax.swing.*;
import java.awt.*;
public class win {
public static void main(String[] args) {
JFrame guiWindow = new JFrame("Calculator");
guiWindow.setBackground(Color.RED); // <---- Nope :(
guiWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
guiWindow.setSize(260, 253);
guiWindow.setLocation(200, 130);
guiWindow.setVisible(true);
}
}
If someone can tell me what I'm doing wrong or point me in the right direction it would be appreciated. Thanks.