在SWT中设置颜色 [英] Setting Colors in SWT
本文介绍了在SWT中设置颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这很简单,我来自swing / awt背景。
This is pretty simple, I come from a swing/awt background.
我只是想知道什么是正确的方式来设置SWT小部件的背景颜色是?
I'm just wondering what the proper way to set the background color for a SWT widget is?
我一直在尝试:
widget.setBackground( );
$ b
Except I have no idea how to create the color Object in SWT?
推荐答案
要创建颜色,请尝试:
Device device = Display.getCurrent ();
Color red = new Color (device, 255, 0, 0);
这篇关于在SWT中设置颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文