How to add an on/off sliders in SWT?

浪尽此生 提交于 2019-12-13 02:45:28

问题


I found a similar question on SO but it is in Swing. I want the same thing in SWT.

So how can I make an ON/OFF slider in SWT?


回答1:


The opal project has a SwitchButton which should be exactly what you are searching for. Here is a screenshot:

You can use it like this:

SwitchButton button = new SwitchButton(shell, SWT.NONE);
button.setTextForSelect("ON");
button.setTextForUnselect("OFF");


来源:https://stackoverflow.com/questions/14496663/how-to-add-an-on-off-sliders-in-swt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!