日期:2014-05-20 浏览次数:20805 次
public Window(final Display display) { shell = new Shell(display); display.asyncExec(new Runnable() { public void run() { Shell shellBrowser = new Shell(display); shellBrowser.setText("技术监督服务平台"); shellBrowser.setLocation(Display.getCurrent().getClientArea().width / 2 - shellBrowser.getShell().getSize().x/2, Display.getCurrent() .getClientArea().height / 2 - shellBrowser.getSize().y/2); shellBrowser.setMaximized(true); shellBrowser.setLayout(new FillLayout()); Browser browser = new Browser(shellBrowser, SWT.NONE); BrowserTest1.initialize(display, browser); shellBrowser.open(); browser.setUrl("http://localhost:8089/tssp/index.jsp?security=madf823sdfasd09213"); while (!shellBrowser.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } }
Caused by: org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at com.sihan.epis.client.Window$1.run(Window.java:35) at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source) ... 5 more Caused by: org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.widgets.Widget.error(Unknown Source) at org.eclipse.swt.widgets.Widget.checkWidget(Unknown Source) at org.eclipse.swt.browser.Browser.checkWidget(Unknown Source) at org.eclipse.swt.browser.Browser.getUrl(Unknown Source) at com.sihan.epis.client.BrowserTest1$2$1.run(BrowserTest1.java:64) at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source) ... 10 more