How to change the background color for JPanels with Nimbus Look and Feel?
问题 I want to use a different background color for all my JPanels in an application. How can I do that when using Nimbus Look and Feel? I follow Changing the Color Theme to change the color of components in Nimbus Look and Feel. It only works sometimes, randomly . If I set a PropertyChagneListener before I change the color, it is only notified once . Here is some test code: public class RedPanels extends JFrame { public RedPanels() { JPanel panel = new JPanel(); add(panel); setPreferredSize(new