public static void main(String[] args) {
   Display display = new Display();
   AddressBook application = new AddressBook();
   Shell shell = application.open(display);
   while (!shell.isDisposed()) {
     if (!display.readAndDispatch()) display.sleep();
   }
   display.dispose();
 }
 public static void main(String[] args) {
   Display display = new Display();
   MessageWindow application = new MessageWindow();
   Shell shell = application.open(display);
   if (args.length != 0) {
     application.openAddressBook(args[0]);
   }
   while (!shell.isDisposed()) {
     if (!display.readAndDispatch()) display.sleep();
   }
   display.dispose();
 }
 /** Invokes as a standalone program. */
 public static void main(String[] args) {
   Display display = new Display();
   Shell shell = new Shell(display, SWT.SHELL_TRIM);
   shell.setLayout(new FillLayout());
   ControlExample instance = new ControlExample(shell);
   shell.setText(getResourceString("window.title"));
   setShellSize(instance, shell);
   shell.open();
   while (!shell.isDisposed()) {
     if (!display.readAndDispatch()) display.sleep();
   }
   instance.dispose();
   display.dispose();
 }
 public static void main(String[] args) {
   Display display = Display.getDefault();
   Shell shell = new Shell(display);
   @SuppressWarnings("unused")
   MainWindow inst = new MainWindow(shell, SWT.NULL);
   shell.setLayout(new FillLayout());
   shell.setImage(SWTResourceManager.getImage("images/16x16.png"));
   shell.setText("Change This Title");
   shell.setBackgroundImage(SWTResourceManager.getImage("images/ToolbarBackground.gif"));
   shell.layout();
   shell.open();
   while (!shell.isDisposed()) {
     if (!display.readAndDispatch()) display.sleep();
   }
 }