Java tutorial
import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class CTabFolderGradientBackground { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Show CTabFolder"); shell.setLayout(new GridLayout(1, true)); CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP); tabFolder.setBorderVisible(true); tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH)); // Set up a gradient background for the selected tab tabFolder.setSelectionBackground(new Color[] { display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW), display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW), display.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW) }, new int[] { 50, 100 }); new CTabItem(tabFolder, SWT.NONE, 0).setText("Tab index 1 "); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }