FileDocCategorySizeDatePackage
TabClass.javaAPI DocExample851Wed Mar 10 16:10:58 GMT 2004org.cookbook.ch10

TabClass

public class TabClass extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		Display display = new Display();
		final Shell shell = new Shell(display);
		shell.setText("Tab Folder Example");
		shell.setSize(450, 250);

		final TabFolder tabFolder = new TabFolder(shell, SWT.BORDER);

		for (int loopIndex = 0; loopIndex < 10; loopIndex++)
		{
			TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
			tabItem.setText("Tab " + loopIndex);

			Text text = new Text(tabFolder, SWT.BORDER);
			text.setText("This is page " + loopIndex);
			tabItem.setControl(text);
		}
		tabFolder.setSize(400, 200);

		shell.open();
		while (!shell.isDisposed())
		{
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();