Coding Your First SWT Program: Hello World : SWT Basics « SWT « Java Tutorial






Coding Your First SWT Program: Hello World
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

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

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

    shell.open();
    // Set up the event loop.
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        // If no more entries in the event queue
        display.sleep();
      }
    }
    display.dispose();
  }
}








17.1.SWT Basics
17.1.1.Two simple rules to guide your disposal efforts
17.1.2.Operating System Resources
17.1.3.The SWT Class-Constants and Methods
17.1.4.Coding Your First SWT Program: Hello WorldCoding Your First SWT Program: Hello World
17.1.5.SWT useful utilities