Group Tutorial - ecsoya/eclipse.tutorial GitHub Wiki

Group除了可以设置标题外,其它的属性和Composite一样。

	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setText("Group Tutorial");
	shell.setLayout(new RowLayout());

	Group group = new Group(shell, SWT.NONE);
	group.setText("Foxes vs. Dogs");

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

如图:

images/image_swt_group.png


参考资料:


上一篇:Canvas Tutorial 下一篇:TabFolder Tutorial