问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/9310907/java-nimbus-button-foreground-not-working