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();

相关文章:

  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
  • 2022-02-20
  • 2021-06-26
  • 2021-12-24
猜你喜欢
  • 2021-12-22
  • 2021-07-13
  • 2021-07-09
  • 2022-01-27
  • 2021-11-08
  • 2021-09-06
相关资源
相似解决方案