Group코드보기
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
public class Ch3_Group extends Composite {
public Ch3_Group(Composite parent){
super(parent, SWT.NONE);
Group group = new Group(this, SWT.SHADOW_ETCHED_IN);
group.setText("Group Label");
Label label = new Label(group, SWT.NONE);
label.setText("Two Buttons : ");
label.setLocation(20, 20);
label.pack();
Button button1 = new Button(group, SWT.PUSH);
button1.setText("Push Button");
button1.setLocation(20, 45);
button1.pack();
Button button2 = new Button(group, SWT.CHECK);
button2.setText("Check button");
button2.setBounds(20, 75, 100, 30);
group.pack();
}
}
CompViewer코드보기
import org.eclipse.jface.window.*;
import org.eclipse.swt.widgets.*;
public class CompViewer extends ApplicationWindow {
public CompViewer() {
super(null);
}
protected Control createContents(Composite parent){
Ch3_Group cc1 = new Ch3_Group(parent);
return parent;
}
public static void main(String[] args) {
CompViewer cv = new CompViewer();
cv.setBlockOnOpen(true);
cv.open();
Display.getCurrent().dispose();
}
}
--------------------------------
Group + CompViewer
http://dynast.tistory.com/trackback/143