new ProgressBar(Shell shell, SWT.HORIZONTAL | SWT.INDETERMINATE) : ProgressBar « org.eclipse.swt.widgets « Java by API






new ProgressBar(Shell shell, SWT.HORIZONTAL | SWT.INDETERMINATE)


import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.widgets.Shell;

public class MainClass {

  public static void main(String[] a) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new GridLayout());

    // Create an indeterminate progress bar
    ProgressBar pb2 = new ProgressBar(shell, SWT.HORIZONTAL | SWT.INDETERMINATE);
    pb2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
}

           
       








Related examples in the same category

1.new ProgressBar(Composite parent, int style)
2.new ProgressBar(Shell shell, SWT.HORIZONTAL | SWT.SMOOTH)
3.ProgressBar: setMaximum(int value)
4.ProgressBar: setMinimum(int value)
5.ProgressBar: setSelection(int value)