如何改变一个残疾人按钮,在Java中(NetBeans的)文本颜色为黑色? [英] How to change the text color of a disabled button to black in Java (NetBeans)?

查看:291
本文介绍了如何改变一个残疾人按钮,在Java中(NetBeans的)文本颜色为黑色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发通过使用NetBeans Java中的GUI和我喜欢被禁用按钮的文本颜色改为黑色。

下面的命令是工作的罚款与组合框:

  UIManager.getDefaults()把(ComboBox.disabledForeground,Color.BLACK)。

一个按钮下面的命令没有EFFEKT:

  UIManager.getDefaults()把(Button.disabledForeground,Color.BLACK)。

  UIManager.getDefaults()把(Button.disabledText,Color.BLACK)。

我希望有人能帮助我。

感谢您提前。结果
斯特芬


解决方案

  UIManager.getDefaults()把(Button.disabledText,Color.RED)。

为我工作

I'm developing a GUI in Java by use of NetBeans and I like to change the text color of a disabled button to black.

The following command is working fine with a combo box:

UIManager.getDefaults().put("ComboBox.disabledForeground", Color.BLACK);

With a Button the following commands have no effekt:

UIManager.getDefaults().put("Button.disabledForeground", Color.BLACK);

or

UIManager.getDefaults().put("Button.disabledText", Color.BLACK);

I hope somebody can help me.

Thank you in advance.
Steffen

解决方案

 UIManager.getDefaults().put("Button.disabledText",Color.RED);

working for me

这篇关于如何改变一个残疾人按钮,在Java中(NetBeans的)文本颜色为黑色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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