JOptionPane and dispose() problems [message #8666] |
Wed, 22 October 2008 02:28 |
Eclipse User |
|
|
|
Originally posted by: stephan.nagy.gmail.com
Hi,
We recently switched from our much hacked on EmbeddedSwingComposite to
Alberio, and I'm happy to say many of the problems we had experienced
have gone away. However, we have encountered a new problem that we are
a bit puzzled by.
When we spawn JOptionPane from our SwingControl we get the stack at the
end of this email dispose. We hacked on the JOptionPane and replaced
dialog.show();
dialog.dispose();
with
dialog.setVisible(true);
dialog.setVisible(false);
SwingUtilities.invokeLater(new Runnable() {public void run() {
dialog.dispose();
}});
which makes the problem go away, but isn't really an acceptable
solution. Any thoughts or ideas on how we might avoid the problem?
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:3563)
at org.eclipse.swt.SWT.error(SWT.java:3481)
at org.eclipse.swt.SWT.error(SWT.java:3452)
at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:325)
at org.eclipse.swt.widgets.Shell.forceActive(Shell.java:806)
at org.eclipse.albireo.internal.SwtInputBlocker.open(Unknown Source)
at org.eclipse.albireo.internal.SwtInputBlocker.block(Unknown Source)
at org.eclipse.albireo.internal.AwtDialogListener$2.run(Unknown
Source)
at org.eclipse.albireo.core.ThreadingHandler$1.run(Unknown Source)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:129)
at
org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
at org.eclipse.swing.integration.SwtInputBlocker.open(Unknown Source)
at org.eclipse.swing.integration.SwtInputBlocker.block(Unknown
Source)
at org.eclipse.swing.integration.AwtDialogListener$2.run(Unknow n
Source)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:129)
at
org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
at
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at com.tripos.nexus.application.NexusApplication.start(Unknown
Source)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
|
|
|
|
Re: JOptionPane and dispose() problems [message #8690 is a reply to message #8679] |
Fri, 24 October 2008 19:41 |
Eclipse User |
|
|
|
Originally posted by: stephan.nagy.gmail.com
Thanks, we will give it a try.
Gordon Hirsch wrote:
> This sounds like a bug that was fixed in the code after the most recent
> release. Basically the call to forceActive() from SwtInputBlocker needs
> to be wrapped in an if statement that makes sure the shell has not been
> disposed. (More info:
> http://dev.eclipse.org/mhonarc/lists/albireo-dev/msg00250.ht ml)
>
> If you check out the most recent source code from CVS and build it,
> you'll have the fix.
>
> Meanwhile, I guess it's about time to release a new version of the code.
> I'll try to get to that in the next week or so.
>
> Stephan Nagy wrote:
>> Hi,
>>
>> We recently switched from our much hacked on EmbeddedSwingComposite to
>> Alberio, and I'm happy to say many of the problems we had experienced
>> have gone away. However, we have encountered a new problem that we
>> are a bit puzzled by.
>>
>> When we spawn JOptionPane from our SwingControl we get the stack at
>> the end of this email dispose. We hacked on the JOptionPane and replaced
>>
>> dialog.show();
>> dialog.dispose();
>>
>> with
>>
>> dialog.setVisible(true);
>> dialog.setVisible(false);
>> SwingUtilities.invokeLater(new Runnable() {public void run() {
>> dialog.dispose();
>> }});
>>
>> which makes the problem go away, but isn't really an acceptable
>> solution. Any thoughts or ideas on how we might avoid the problem?
>>
>> org.eclipse.swt.SWTException: Widget is disposed
>>
>> at org.eclipse.swt.SWT.error(SWT.java:3563)
>>
>> at org.eclipse.swt.SWT.error(SWT.java:3481)
>>
>> at org.eclipse.swt.SWT.error(SWT.java:3452)
>>
>> at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
>>
>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:325)
>>
>> at org.eclipse.swt.widgets.Shell.forceActive(Shell.java:806)
>>
>> at org.eclipse.albireo.internal.SwtInputBlocker.open(Unknown
>> Source)
>>
>> at org.eclipse.albireo.internal.SwtInputBlocker.block(Unknown
>> Source)
>>
>> at org.eclipse.albireo.internal.AwtDialogListener$2.run(Unknown
>> Source)
>>
>> at org.eclipse.albireo.core.ThreadingHandler$1.run(Unknown Source)
>>
>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>
>> at
>> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:129)
>>
>>
>> at
>> org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
>>
>> at
>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
>>
>> at org.eclipse.swing.integration.SwtInputBlocker.open(Unknown
>> Source)
>>
>> at org.eclipse.swing.integration.SwtInputBlocker.block(Unknown
>> Source)
>>
>> at org.eclipse.swing.integration.AwtDialogListener$2.run(Unknow n
>> Source)
>>
>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>
>> at
>> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:129)
>>
>>
>> at
>> org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
>>
>> at
>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
>>
>> at
>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>
>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>
>>
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>
>>
>> at
>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>
>> at com.tripos.nexus.application.NexusApplication.start(Unknown
>> Source)
>>
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>
>> at java.lang.reflect.Method.invoke(Unknown Source)
>>
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>
|
|
|
|
Re: JOptionPane and dispose() problems [message #574547 is a reply to message #8679] |
Fri, 24 October 2008 19:41 |
Eclipse User |
|
|
|
Originally posted by: stephan.nagy.gmail.com
Thanks, we will give it a try.
Gordon Hirsch wrote:
> This sounds like a bug that was fixed in the code after the most recent
> release. Basically the call to forceActive() from SwtInputBlocker needs
> to be wrapped in an if statement that makes sure the shell has not been
> disposed. (More info:
> http://dev.eclipse.org/mhonarc/lists/albireo-dev/msg00250.ht ml)
>
> If you check out the most recent source code from CVS and build it,
> you'll have the fix.
>
> Meanwhile, I guess it's about time to release a new version of the code.
> I'll try to get to that in the next week or so.
>
> Stephan Nagy wrote:
>> Hi,
>>
>> We recently switched from our much hacked on EmbeddedSwingComposite to
>> Alberio, and I'm happy to say many of the problems we had experienced
>> have gone away. However, we have encountered a new problem that we
>> are a bit puzzled by.
>>
>> When we spawn JOptionPane from our SwingControl we get the stack at
>> the end of this email dispose. We hacked on the JOptionPane and replaced
>>
>> dialog.show();
>> dialog.dispose();
>>
>> with
>>
>> dialog.setVisible(true);
>> dialog.setVisible(false);
>> SwingUtilities.invokeLater(new Runnable() {public void run() {
>> dialog.dispose();
>> }});
>>
>> which makes the problem go away, but isn't really an acceptable
>> solution. Any thoughts or ideas on how we might avoid the problem?
>>
>> org.eclipse.swt.SWTException: Widget is disposed
>>
>> at org.eclipse.swt.SWT.error(SWT.java:3563)
>>
>> at org.eclipse.swt.SWT.error(SWT.java:3481)
>>
>> at org.eclipse.swt.SWT.error(SWT.java:3452)
>>
>> at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
>>
>> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:325)
>>
>> at org.eclipse.swt.widgets.Shell.forceActive(Shell.java:806)
>>
>> at org.eclipse.albireo.internal.SwtInputBlocker.open(Unknown
>> Source)
>>
>> at org.eclipse.albireo.internal.SwtInputBlocker.block(Unknown
>> Source)
>>
>> at org.eclipse.albireo.internal.AwtDialogListener$2.run(Unknown
>> Source)
>>
>> at org.eclipse.albireo.core.ThreadingHandler$1.run(Unknown Source)
>>
>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>
>> at
>> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:129)
>>
>>
>> at
>> org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
>>
>> at
>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
>>
>> at org.eclipse.swing.integration.SwtInputBlocker.open(Unknown
>> Source)
>>
>> at org.eclipse.swing.integration.SwtInputBlocker.block(Unknown
>> Source)
>>
>> at org.eclipse.swing.integration.AwtDialogListener$2.run(Unknow n
>> Source)
>>
>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>
>> at
>> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:129)
>>
>>
>> at
>> org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3659)
>>
>> at
>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3296)
>>
>> at
>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>
>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>
>>
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>
>>
>> at
>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>
>> at com.tripos.nexus.application.NexusApplication.start(Unknown
>> Source)
>>
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>
>> at java.lang.reflect.Method.invoke(Unknown Source)
>>
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03136 seconds