Slider: setPageIncrement(int value) : Slider « org.eclipse.swt.widgets « Java by API






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

1.new Slider(Composite parent, int style)
2.Slider: addListener(int state, Listener lis)
3.Slider: getSelection()
4.Slider: setIncrement(int value)
5.Slider: setMaximum(int value)
6.Slider: setMinimum(int value)