package com.layotech.www.study;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
public class GroupTest {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
Group group = new Group(shell,SWT.NONE);
group.setText("分组");
group.setLayout(new RowLayout());
for(int i=0;i<4;i++){
Button button = new Button(group,SWT.PUSH);
button.setText("按钮" + i);
}
group.pack();
shell.open();
while(!shell.isDisposed()){
if(!display.readAndDispatch()){
display.sleep();
}
}
display.dispose();
}
}