问题
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