I'm trying to set the background color in my custom JOptionPane and no matter what, I cannot get the message part of the option pane to change color.
Attempt #1 was to set the pane background and opaque.
Attempt #2 was to also loop through the pane's components, and set the opaque and/or background attributes if they were JPanel or JLabel.
This did not work for the message part. From what I can see, the JPanel does not even exist as one of the components.
Attempt #3 was to use UIManager, however this is not working consistently.
What I mean is, if you were to run the program 5 times, sometimes no background colors are changed, sometimes they all are changed, and sometimes some of them are changed.
I am running inside an invokeLater thread.
UIManager.put("OptionPane.background",Color.white);
UIManager.put("JOptionPane.background",Color.white);
UIManager.put("Panel.background",Color.white);
UIManager.put("JPanel.background",Color.white);
Any ideas?