Composite parent = new Composite(shell, SWT.NONE); parent.setLocation(10, 10); parent.setSize(200, 100); parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
Composite group = new Composite(shell, SWT.NONE); group.setLayout(new GridLayout(2, false)); group.setBackground(new Color(Display.getCurrent(), 255, 255, 0));In this example, a composite with a grid layout is created and its background color is set to yellow using the setBackground method. The package library for the org.eclipse.swt.widgets Composite class is SWT, which stands for the Standard Widget Toolkit. This package is included in the Eclipse IDE and provides a set of widgets and tools for creating graphical user interfaces.