`

实用的SWT代码片段收集记录

 
阅读更多

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(右上角有最小化、关闭按钮)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics