Slider: setPageIncrement(int value)
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Slider;
public class MainClass {
public static void main(String[] a) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
// Create a horizontal slider, accepting the defaults
new Slider(shell, SWT.HORIZONTAL);
// Create a vertical slider and set its properties
Slider slider = new Slider(shell, SWT.VERTICAL);
slider.setMinimum(0);
slider.setMaximum(100);
slider.setIncrement(5);
slider.setPageIncrement(20);
slider.setSelection(75);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
Related examples in the same category