Skip to content

Instantly share code, notes, and snippets.

@vogella
Last active November 24, 2016 09:50
Show Gist options
  • Save vogella/9c772bde631976f6c46e2f8a6f58fd0d to your computer and use it in GitHub Desktop.
Save vogella/9c772bde631976f6c46e2f8a6f58fd0d to your computer and use it in GitHub Desktop.
import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class Main {
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
Button feedTheDog = new Button (shell, SWT.PUSH);
feedTheDog.setText("Feed the dog");
shell.setLayout (new RowLayout ());
shell.pack ();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment