1. 窗体相对屏幕居中
shell.setLocation(Display.getCurrent().getClientArea().width / 2 - shell.getSize().x / 2,
Display.getCurrent().getClientArea().height / 2 - shell.getSize().y / 2);
2. 禁止窗体最大化
Shell shell = new Shell(display, SWT.CLOSE); // 新建shell对象时,指定样式SWT.CLOSE(右上角有最小化、关闭按钮)