JFrame.setBackground() not working -- why?
- by devoured elysium
JFrame mainFrame = new JFrame();
mainFrame.setSize(100, 100);
mainFrame.setBackground(Color.CYAN);
mainFrame.setVisible(true);
My intent is to create a window with a cyan background. What is wrong with this? My window doesn't get cyan, as I'd expect!
Also, could anyone point out why I seem to have all the colors in duplicate (there's a Color.CYAN and a Color.cyan). Is there any difference at all between the two? Maybe the older one was a constant from before there were enums in Java and the second one is from the Enum?
Thanks