Example usage for org.eclipse.swt.widgets Display dispose

List of usage examples for org.eclipse.swt.widgets Display dispose

Introduction

In this page you can find the example usage for org.eclipse.swt.widgets Display dispose.

Prototype

public void dispose() 

Source Link

Usage

From source file:HelloWorld3.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new HelloWorld3().open(display);
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();/*w  w w. jav a  2  s  . c o  m*/
    }
    display.dispose();
}

From source file:org.eclipse.swt.examples.helloworld.HelloWorld2.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new HelloWorld2().open(display);
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();/*from  w w w. j a v a  2 s  .  c o  m*/
    }
    display.dispose();
}

From source file:DirectoryDialogGetSelectedDirectory.java

public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display);

    DirectoryDialog dlg = new DirectoryDialog(shell);
    String selectedDirectory = dlg.open();

    System.out.println(selectedDirectory);

    display.dispose();

}

From source file:MainClass.java

public static void main(String[] a) {
    Display d = new Display();
    Shell s = new Shell(d, SWT.CLOSE | SWT.RESIZE);
    s.setSize(300, 300);/*w w w.j a  v  a2s  . com*/
    s.open();
    while (!s.isDisposed()) {
        if (!d.readAndDispatch())
            d.sleep();
    }
    d.dispose();
}

From source file:HelloWorld5.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new HelloWorld5().open(display);
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();/*ww  w  .  j  a  va 2s  .c o m*/
    }
    display.dispose();
}

From source file:MainClass.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    WizardDialog dlg = new WizardDialog(shell, new SurveyWizard());
    dlg.open();/* w w w  . j a v  a 2s .c  o m*/
    display.dispose();
}

From source file:ShellMini.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setMinimized(true);/*ww  w  .  j a v a 2s .  com*/
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}

From source file:Snippet28.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setMaximized(true);/*from   w w w  . ja va 2  s  .  co  m*/
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}

From source file:FileDialogOpenSelectedName.java

public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display);

    FileDialog dlg = new FileDialog(shell, SWT.OPEN);
    String fileName = dlg.open();
    if (fileName != null) {
        System.out.println(fileName);
    }//  w ww.  java 2  s. c  o  m

    display.dispose();

}

From source file:MainClass.java

public static void main(String[] a) {
    Display d = new Display();
    Shell s = new Shell(d);
    s.setSize(500, 500);//from w  w  w . j av a 2 s  .  c  om
    s.open();
    ChildShell cs = new ChildShell(s);
    while (!s.isDisposed()) {
        if (!d.readAndDispatch())
            d.sleep();
    }
    d.dispose();

}