import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class GUI { public static void main(String[] args) { Display display = new Display (); Shell shell = new GUI().open (display); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } public Shell open (Display display) { Shell shell = new Shell (display); /* * Init other graphical elements here! */ shell.open(); return shell; } }