Java Nimbus Button.foreground not working

I am using Nimbus LAF in my application and I want to change all the colors of the foreground buttons. I am doing this setup:

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

But that does not work. Maybe this is because I should use only the primary and secondary colors of Nimbus? Can anyone help me?

Many thanks.

+4
source share
1 answer
 simple way 

1) you can set the Color once by placing the value in the UIManager , then it will be valid for the target instance (e.g. JLabel)

2) dynamically re-install and override UIManager

 most complex way 

3) create your own UIManager , for example, aephyr

EDIT:

<to avoid creating your own Painters / ">, perhaps the correct way might be to use non_buggy and todays Custom Look and Feel

+2
source

Source: https://habr.com/ru/post/1396829/


All Articles