Java Nimbus Button.foreground无法正常工作 [英] Java Nimbus Button.foreground not working

查看:109
本文介绍了Java Nimbus Button.foreground无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序上使用了Nimbus LAF,我想更改所有按钮的前景色.我执行此设置:

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);

但是这不起作用.也许是因为我应该只使用主要和辅助的Nimbus颜色?有人可以帮我吗?

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

非常感谢.

推荐答案

simple way

1)您可以通过将值设置为UIManager来设置一次颜色,然后对整个有效(对于JLabel实例)

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

2)动态反复设置和覆盖UIManager

most complex way

3)创建自己的UIManager,例如通过 aephyr

3) create own UIManager, for example by aephyr

<为避免创建自己的Painters/>,也许正确的方法可能是使用non_buggy和当今的自定义外观和感觉

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

这篇关于Java Nimbus Button.foreground无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆