怎么让WizardDialog能最小化到任务栏,而且不能使用最大化按钮,谢谢。
public class Main {
public static void main(String[] args) {
Display display = new Display();
Rectangle bounds = display.getPrimaryMonitor().getBounds(); Shell shell = new Shell(display);
Rectangle rect = shell.getBounds();
int x = bounds.x + (bounds.width - rect.width) / 2;
int y = bounds.y + (bounds.height - rect.height) / 2;
shell.setLocation(x, y);
WizardDialog dlg = new WizardDialog(shell, new pBuildWizard());
WizardDialog.setDefaultImage(new Image(Display.getCurrent(), "pBuild_ICON.jpg"));
dlg.open();
display.dispose();
}
}

解决方案 »

  1.   

    只需把: Shell shell = new Shell(display);
    改成:  Shell shell = new Shell(display,SWT.DIALOG_TRIM | SWT.MIN  | SWT.RESIZE );
      

  2.   


    我要是怎么让WizardDialog dlg能最小化到任务栏,而且不能使用最大化按钮,不是shell,上面说的方法还是不能让dlg最小化。
    谢谢。
      

  3.   

    那么再试试这个:Shell shell = new Shell(display,SWT.MODELESS | SWT.DIALOG_TRIM | SWT.MIN  | SWT.RESIZE ); 
      

  4.   

    有一阵没用过WizardDialog了,应该是这样:要写个新的类TestWizardDialog:
    public class TestWizardDialog extends WizardDialog {

    public TestWizardDialog (final Shell parentShell, final IWizard newWizard) {
    super(parentShell, newWizard);
    } @Override
    protected void setShellStyle(final int newShellStyle) {
    super.setShellStyle(SWT.CLOSE | SWT.MIN | SWT.TITLE | SWT.BORDER
    | SWT.MODELESS | SWT.RESIZE | getDefaultOrientation());
    }然后在你的程序里用这个类就可以了。