首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

RCP的主窗口在圆桌面自动居中显示的方法

2013-02-19 
RCP的主窗口在桌面自动居中显示的方法public class ApplicationWorkbenchWindowAdvisor extends Workbench

RCP的主窗口在桌面自动居中显示的方法
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {@Overridepublic void postWindowOpen() {super.postWindowOpen();// 居中窗口Shell shell = getWindowConfigurer().getWindow().getShell();Rectangle screenSize = Display.getDefault().getClientArea();Rectangle frameSize = shell.getBounds();shell.setLocation((screenSize.width - frameSize.width) / 2,(screenSize.height - frameSize.height) / 2);}}

?

热点排行