我可以更改禁用的swt控件的前景色

时间:2011-06-22 13:25:55

标签: java swt

我需要将禁用控件的前景色设置为黑色而不是灰色。我看到可以设置背景颜色但我无法设置前景色。它可以吗?如果是这样,怎么样?

2 个答案:

答案 0 :(得分:2)

取决于您想要更改回/前景的控件。在SWT Javadoc the setBackgroundColor method中,您可以找到此说明

Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.

答案 1 :(得分:1)

如果它非常重要,您可以通过挂钩绘画事件自己绘制文本......我没有尝试过: - )