⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tabclass.java

📁 eclipse cookbook the source code of the book
💻 JAVA
字号:
package org.cookbook.ch10;

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class TabClass
{
	public static void main(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();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -