public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); FillLayout layout = new FillLayout(); layout.marginHeight = 50; layout.marginWidth = 50; shell.setLayout(layout); Composite c = new Composite(shell, SWT.NONE); c.setBackground(display.getSystemColor(SWT.COLOR_BLUE)); c.setLayout(new FillLayout()); Composite c2 = new Composite(c, SWT.NONE); c2.setBackground(display.getSystemColor(SWT.COLOR_RED)); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }