I am trying to make a planner and want to change the background of my JFrame.
I have already tried frame.getContentPane().setBackground(Color.);
but that doesn't seem to work.
Here is the code for the frame portion
`public Planner(){
frame = new JFrame();
main = new JPanel();
menu = new Menu(this);
frame.setPreferredSize(preferredSize);
frame.add(main);
frame.setJMenuBar(menu);
frame.pack();
frame.setVisible(true);
frame.setLocationRelativeTo(null);
frame.setIconImage(Toolkit.getDefaultToolkit().getImage("Icon.png"));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("Myva");
JLabel loading = new JLabel();
JOptionPane pane = new JOptionPane();
pane.showMessageDialog( null, "Hi. ");
name = pane.showInputDialog("What is your name:");
}
Thanks in advance