forked from teddyzhang1976/ThinkInJava4thSampleCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloSWT.java
More file actions
18 lines (17 loc) · 548 Bytes
/
HelloSWT.java
File metadata and controls
18 lines (17 loc) · 548 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//: swt/HelloSWT.java
package swt; /* Added by Eclipse.py */
// {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();
}
} ///:~