问题
I'm trying to overrides some of the nimbus properties for JLabel.
UIDefaults labelDefault = new UIDefaults();
labelDefault.put("Label.font", new FontUIResource("Arial", Font.PLAIN, 14));
labelDefault.put("Label.foreground", new ColorUIResource(210, 210, 210));
label.putClientProperty("Nimbus.Overrides", labelDefault);
label.putClientProperty("Nimbus.Overrides.InheritDefaults",false);
For the font it works correctly, but not for the color. Is it possible to change the color this way ? Thank you.
回答1:
this works:
labelDefault.put("Label[Enabled].textForeground", new ColorUIResource(210, 210, 210));
来源:https://stackoverflow.com/questions/5835129/overrides-nimbus-properties