4

I am using the Nimbus LAF on my application and I want to change all buttons foreground colors. I do this setting:

UIManager.put("Button.foreground", Color.WHITE);

But this is not working. Maybe it is because I should only use the primary and secondary Nimbus colors? Could anyone help me please?

Thanks a lot.

Lucas
  • 113
  • 6

1 Answers1

2
simple way

1) you can set Color once by put value to UIManager, then will be valid for whole (for example JLabel) instance

2) dynamically set and override UIManager repeatedly

most complex way

3) create own UIManager, for example by aephyr

EDIT:

< to avoiding to create own Painters /> maybe correct way could be use non_buggy and todays Custom Look and Feel

Community
  • 1
  • 1
mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • Thank you mKorbel, I followed the simple way, but it didn't worked for the buttons. The most complex way works changing the background color of panels, but not for buttons (with the property Button.foreground). Maybe it is my Java version? 1.6.0_26 for Linux. – Lucas Feb 17 '12 at 19:34
  • please read [JButton background on Nimbus LAF](http://stackoverflow.com/a/5857229/714968) – mKorbel Feb 17 '12 at 23:51