Composite composite = new Composite(shell, SWT.NONE); // Add widgets to composite composite.dispose();
for (Control control : composite.getChildren()) { control.dispose(); } composite.dispose();In this example, we have a composite with multiple child widgets. We dispose of each child widget and then dispose of the composite itself. This method is part of the org.eclipse.swt.widgets package library.