Window: setBlockOnOpen(boolean arg0) : Window « org.eclipse.jface.window « Java by API






Window: setBlockOnOpen(boolean arg0)

import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;

public class MainClass extends ApplicationWindow {
  public MainClass() {
    super(null);
  }

  public void run() {
    setBlockOnOpen(true);
    open();
    Display.getCurrent().dispose();
  }

  protected Control createContents(Composite parent) {
    Label label = new Label(parent, SWT.CENTER);
    label.setText("Hello, World");
    return label;
  }

  public static void main(String[] args) {
    new MainClass().run();
  }
}

           
       








Related examples in the same category