RSS

Search Engine

Friday, June 11, 2010

Your first SWT Application

Create a new Java project "de.vogella.swt.first" and add the "swt.jar" to the build path. Create the following class.

   
package de.vogella.swt.first;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class FirstSWTApplication {

public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell(display);
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}

If you run this application you will receive an empty shell.

0 comments:

Post a Comment