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:Snippet105.java

public static void main(String[] args) {
    Display display = new Display();
    Program.launch("c:\\cygwin\\cygwin.bat");
    display.dispose();
}

From source file:Snippet30.java

public static void main(String[] args) {
    Display display = new Display();
    Program p = Program.findProgram(".txt");
    if (p != null)
        p.execute("c:\\autoexec.bat");
    display.dispose();
}

From source file:org.eclipse.swt.snippets.Snippet30.java

public static void main(String[] args) {
    Display display = new Display();
    Program p = Program.findProgram(".txt");
    if (p != null)
        p.execute("newfile");
    display.dispose();
}

From source file:DisplayBounds.java

public static void main(String[] args) {
    Display display = new Display();
    System.out.println(/*from   w  ww .  j av a 2  s . c  om*/
            "Display Bounds=" + display.getBounds() + " Display ClientArea=" + display.getClientArea());
    display.dispose();
}

From source file:InvokeSystemTextEditor.java

public static void main(String[] args) {
    Display display = new Display();
    Program p = Program.findProgram(".txt");
    if (p != null)
        p.execute("c:\\autoexec.bat"); // Windows-specific filename
    display.dispose();
}

From source file:ColorCreate.java

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

    RGB rgb = new RGB(255, 0, 0); // pure red
    Color color = new Color(display, rgb);

    System.out.println(color.getBlue());

    display.dispose();
}

From source file:Snippet18.java

public static void main(String[] args) {
    Shell shell = new Shell();
    ToolBar bar = new ToolBar(shell, SWT.BORDER);
    for (int i = 0; i < 8; i++) {
        ToolItem item = new ToolItem(bar, SWT.PUSH);
        item.setText("Item " + i);
    }/*from   w w w  . j av a  2s.c om*/
    bar.pack();
    shell.open();
    Display display = shell.getDisplay();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    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  a v a 2  s.c  o m*/
    s.open();
    while (!s.isDisposed()) {
        if (!d.readAndDispatch())
            d.sleep();
    }
    d.dispose();
}

From source file:HelloWorld4.java

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

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

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