WizardDialog 默认弹出不居中,下面是让其居中的代码
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), new ScanWizard()); dlg.setPageSize(560, 320); dlg.create(); //设置窗口自动居中 Rectangle screenSize = Display.getDefault().getClientArea(); Shell shell =dlg.getShell(); shell.setLocation((screenSize.width - dlg.getShell().getBounds().width) / 2,( screenSize.height -dlg.getShell().getBounds().height) / 2); dlg.open();
转载于:https://www.cnblogs.com/wuhenke/archive/2012/03/07/2384085.html
相关资源:swt/jface中文教程