java - 如何在切换 SWT.PUSH 按钮时设置较暗的阴影

标签 java swt

默认情况下,如果选择(切换)SWT.PUSH 按钮,则该按钮呈浅蓝色阴影。我想让阴影变暗一点,以便更明显地看到哪些按钮被切换。有谁知道我该怎么做?谢谢。

最佳答案

Control 的文档包含方法 Control#setBackground(Color) 的此部分:

Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.

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.

<小时/>

但是,您可以“劫持”绘画事件并在 Button 上绘制您想要的任何内容。 Here是与此主题相关的问题。

关于java - 如何在切换 SWT.PUSH 按钮时设置较暗的阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17674221/

相关文章:

java - 使用 Java Mac 获取 PID

java - 在枚举中引用枚举

java - 如何设置标签颜色动画以使其发光?

java - 如何使用 Mysaifu JVM 显示图像

java - SWT:通知组合它有一个新的子组件

eclipse - 从 UI 线程调用 PlatformUI.getWorkbench().getDisplay().syncExec

Java:查找调用者类

java - 我们可以使用 REST-Assured 框架设置多个 header 吗

java - 如何以编程方式在 Java 中添加 Lottie 动画

java - Java VM EXCEPTION_ACCESS_VIOLATION 的可能原因?