0

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?

Community
  • 1
  • 1

1 Answers1

1

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

enter image description here

You can use it like this:

SwitchButton button = new SwitchButton(shell, SWT.NONE);
button.setTextForSelect("ON");
button.setTextForUnselect("OFF");
Baz
  • 36,440
  • 11
  • 68
  • 94