21 lines
682 B
Java
21 lines
682 B
Java
// swt/HelloSWT.java
|
|
// (c)2016 MindView LLC: see Copyright.txt
|
|
// We make no guarantees that this code is fit for any purpose.
|
|
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
|
// {Requires: org.eclipse.swt.widgets.Display; You must
|
|
// install the SWT library from http://www.eclipse.org }
|
|
import org.eclipse.swt.widgets.*;
|
|
|
|
public class HelloSWT {
|
|
public static void main(String [] args) {
|
|
Display display = new Display();
|
|
Shell shell = new Shell(display);
|
|
shell.setText("Hi there, SWT!"); // Title bar
|
|
shell.open();
|
|
while(!shell.isDisposed())
|
|
if(!display.readAndDispatch())
|
|
display.sleep();
|
|
display.dispose();
|
|
}
|
|
}
|