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.

No comments:

Post a Comment

How to Block Spam Calls and Messages on Android

Spam calls and messages have gotten bad enough that most people now hesitate before answering any unknown number. The good news is Android h...