package gui; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public abstract class GuiManager { private static Display _display; private static Shell _mainShell; private static Shell _containerShell; public static void initGui() { // init display, shell _display = new Display(); _mainShell = new Shell(_display); // add static gui elements _containerShell = _mainShell; // pack (aka size widgets) and open _mainShell.pack(); _mainShell.open(); // main loop while (!_mainShell.isDisposed()) { if (!_display.readAndDispatch()) _display.sleep(); } _display.dispose(); } }