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

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

Introduction

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

Prototype

public Display() 

Source Link

Document

Constructs a new instance of this class.

Usage

From source file:DisplayBounds.java

public static void main(String[] args) {
    Display display = new Display();
    System.out.println(/*from   ww w  .  j  av  a 2s  .  c om*/
            "Display Bounds=" + display.getBounds() + " Display ClientArea=" + display.getClientArea());
    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 ava2  s .  co  m*/
    s.open();
    while (!s.isDisposed()) {
        if (!d.readAndDispatch())
            d.sleep();
    }
    d.dispose();
}

From source file:ShellMini.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setMinimized(true);//from  w w  w .  ja  v a 2  s.  c o  m
    shell.open();
    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  ava 2s. c o m*/
    s.open();
    ChildShell cs = new ChildShell(s);
    while (!s.isDisposed()) {
        if (!d.readAndDispatch())
            d.sleep();
    }
    d.dispose();

}

From source file:SWTFirst.java

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

    shell.setText("Hello, world!");

    shell.open();/* ww  w.  java  2s.c  om*/
    // Set up the event loop.
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            // If no more entries in the event queue
            display.sleep();
        }
    }
    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  ww  w  .  j a  v  a 2  s .  c o m
}

From source file:ShellWindowToolTip.java

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

    shell.setToolTipText("Shell \n toolTip");

    shell.open();/*from w  ww  .ja va  2 s  . c  o m*/
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}

From source file:DialogShellCreate.java

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

    Shell dialog = new Shell(shell);
    dialog.setText("Dialog");
    dialog.setSize(200, 200);/*  w  w w. ja  v  a2 s . c  o  m*/
    dialog.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}

From source file:SWTEventHandlingDisplay.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setText("Hello, world!");
    shell.open();//  w  w  w .j  av  a  2 s  .com

    while (!shell.isDisposed()) { // Event loop.
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}

From source file:TableRowSelectionRemove.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    final Table table = new Table(shell, SWT.BORDER | SWT.MULTI);
    table.setSize(200, 200);//from ww  w .  jav  a2  s . c  o m
    for (int i = 0; i < 128; i++) {
        TableItem item = new TableItem(table, SWT.NONE);
        item.setText("Item " + i);
    }

    table.setSelection(2);

    table.remove(table.getSelectionIndices());

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