public class TestTitleAreaDialog extends TitleAreaDialog implements test {
public TestTitleAreaDialog(Shell parentShell) {
super(parentShell);
}
/*
* 窗口可改变大小,有最大化最小化按钮
*/
@Override
protected boolean isResizable() {
return true;
}
public static void main(String[] args) {
TestTitleAreaDialog testTitleAreaDialog = new TestTitleAreaDialog(
new Shell());
testTitleAreaDialog.setBlockOnOpen(true);
testTitleAreaDialog.open();
}
@Override
protected Control createDialogArea(Composite parent) {
Composite mainComposite = (Composite) super.createDialogArea(parent);
// 创建详细控件...
// Build the separator line
Label separator = new Label(mainComposite, SWT.HORIZONTAL
| SWT.SEPARATOR);
separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
return parent;
}
}