-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.1.2
-
None
-
sparc
-
solaris_2.5.1
The function LightweightDispatcher.retargetMouseEvent has a timing problem
when the mouse event causes a modal dialog to show.
The System.err shows the following message (to our users!)
Exception occurred during event dispatching:
java.lang.NullPointerException
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:1416)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:1329)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1264)
at java.awt.Container.dispatchEventImpl(Container.java:824)
at java.awt.Component.dispatchEvent(Component.java:1394)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:64)
In our case, there is a lightweight component (that is like a button) that
pops up a FileDialog on the MOUSE_RELEASED event.
The code in LightWeight dispatcher is:
mouseEventTarget.dispatchEvent(retargeted);
// comments omitted
Cursor c = mouseEventTarget.getCursor();
The problem (with modal dialogs especially) is that the dispatchEvent is
blocking with the modal show, and meanwhile another dispatch thread will
deliver the MOUSE_EXITED event which sets the mouseEventTarget to null,
causing the NullPointerException.
If you need an example which will cause this, let me know.
when the mouse event causes a modal dialog to show.
The System.err shows the following message (to our users!)
Exception occurred during event dispatching:
java.lang.NullPointerException
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:1416)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:1329)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1264)
at java.awt.Container.dispatchEventImpl(Container.java:824)
at java.awt.Component.dispatchEvent(Component.java:1394)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:64)
In our case, there is a lightweight component (that is like a button) that
pops up a FileDialog on the MOUSE_RELEASED event.
The code in LightWeight dispatcher is:
mouseEventTarget.dispatchEvent(retargeted);
// comments omitted
Cursor c = mouseEventTarget.getCursor();
The problem (with modal dialogs especially) is that the dispatchEvent is
blocking with the modal show, and meanwhile another dispatch thread will
deliver the MOUSE_EXITED event which sets the mouseEventTarget to null,
causing the NullPointerException.
If you need an example which will cause this, let me know.
- duplicates
-
JDK-4088011 Dismissing dialogs throws exceptions
-
- Closed
-
- relates to
-
JDK-4061337 Modal dialogs which were launched by JButton cause NULLPointerException.
-
- Closed
-