Java and the Nokia N810 Internet Tablet
by Eric J. Bruno

Listing One

import org.eclipse.swt.widgets.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;

public class SWTTest {
  public static void main(String[] args) {
    Display display = Display.getDefault();
    final Shell shell = new Shell(display);
    shell.setLayout(new RowLayout(SWT.VERTICAL));
	
    Label label = new Label(shell, SWT.CENTER);
    label.setText("Hello DDJ!");
		
    Button button = new Button(shell, SWT.NONE);
    button.setText("close");
    button.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        shell.dispose();
      }
    });
    shell.open();
    while (!shell.isDisposed())
      display.readAndDispatch();
  }
}


1


