windowActivated error after closing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

windowActivated error after closing

afro
Hi,
I encountered a problem: I start my plugin, then in this plugin I open Image
Sequences, modify those images, then open other Sequences (with
IJ.run("Image Sequence..."); command) etc...
After all commands have been executed I want to close all ImageWindow with
the command: WindowManager.closeAllWindows();
It works, but after I close these windows I get this error:

Exception in thread "Run$_AWT-EventQueue-0Macro$"
java.lang.NullPointerException
        at ij.gui.ImageWindow.windowActivated(ImageWindow.java:516)
        at java.awt.Window.processWindowEvent(Window.java:1877)
        at java.awt.Window.processEvent(Window.java:1823)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at
java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
        at
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:910)
        at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:409)
        at java.awt.Component.dispatchEventImpl(Component.java:4502)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.SentEvent.dispatch(SentEvent.java:55)
        at
java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(DefaultKeyboardFocusManager.java:183)
        at
java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:210)
        at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:286)
        at java.awt.Component.dispatchEventImpl(Component.java:4502)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.SequencedEvent.dispatch(SequencedEvent.java:101)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


As if it didn't closed the images, and ImageJ is still looking for them, or
what?
It says, that it want to activate an ImagePlus window via windowActivated
action. Of course this window is closed (because I closed it), so the
ImagePlus reference is null.
But how can a windowActivated action occur, if the window has been closed?

I don't understand it.
Please can someone give me some advice?
Thanks!

Joe P.
Reply | Threaded
Open this post in threaded view
|

Re: windowActivated error after closing

Nathaniel Ryckman
I second your report.

afro wrote
Hi,
I encountered a problem: I start my plugin, then in this plugin I open Image
Sequences, modify those images, then open other Sequences (with
IJ.run("Image Sequence..."); command) etc...
After all commands have been executed I want to close all ImageWindow with
the command: WindowManager.closeAllWindows();
It works, but after I close these windows I get this error:

Exception in thread "Run$_AWT-EventQueue-0Macro$"
java.lang.NullPointerException
        at ij.gui.ImageWindow.windowActivated(ImageWindow.java:516)
        at java.awt.Window.processWindowEvent(Window.java:1877)
        at java.awt.Window.processEvent(Window.java:1823)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at
java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
        at
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:910)
        at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:409)
        at java.awt.Component.dispatchEventImpl(Component.java:4502)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.SentEvent.dispatch(SentEvent.java:55)
        at
java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(DefaultKeyboardFocusManager.java:183)
        at
java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:210)
        at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:286)
        at java.awt.Component.dispatchEventImpl(Component.java:4502)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.SequencedEvent.dispatch(SequencedEvent.java:101)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


As if it didn't closed the images, and ImageJ is still looking for them, or
what?
It says, that it want to activate an ImagePlus window via windowActivated
action. Of course this window is closed (because I closed it), so the
ImagePlus reference is null.
But how can a windowActivated action occur, if the window has been closed?

I don't understand it.
Please can someone give me some advice?
Thanks!

Joe P.