我做的是一个RCP应用程序, 修改了application.java,目的是想在程序启动前弹出登陆框,
但是我不知道怎么把这个登陆框放在屏幕中间。
public class Application implements IPlatformRunnable { /* (non-Javadoc)
 * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)
 */
public Object run(Object args) throws Exception {

Display display = PlatformUI.createDisplay();                  //这下面4行是我的对话框 
Shell shell = new Shell(display);
LoginDiaLog login=new LoginDiaLog(shell,SWT.CENTER );
login.open() ;
if (login.getResult()==false) return IPlatformRunnable.EXIT_OK;
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART) {
return IPlatformRunnable.EXIT_RESTART;
}
return IPlatformRunnable.EXIT_OK;
} finally {
display.dispose();
}
}
}