Java Nimbus Button.foreground not working

元气小坏坏 提交于 2019-12-10 17:16:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!