Hi,
When I close one of my dialog (JDialog), this exception is raised. None of
the classes from Exception trace are mine (they are all from javax or java)
. How can I catch or avoid this exception??
<code>Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.plaf.basic.BasicTreeUI.isToggleEvent(BasicTreeUI.java:2192)
at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent
(BasicTreeUI.java:2247)
at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection
(BasicTreeUI.java:3432)
at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed
(BasicTreeUI.java:3393)
at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
at java.awt.Component.processMouseEvent(Component.java:5485)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
</code>
Thanks,
Marie
Ryan Dillon - 25 Mar 2005 00:47 GMT
Where is the JTree? Is it in the dialog, or in the window underneath
it? It could be a bug with the version of Java you are using?
As a workaround, you could define an ExceptionHandler
(http://www.jguru.com/faq/view.jsp?EID=427279) that looks for this
specific Exception (maybe by examining the stack trace) and ignores it.
Cheers
--
Ryan Dillon
Code Canvas Technologies
Sign up for the RapidJ beta!
http://www.codecanvas.com.au/rapidj/
Marie - 29 Mar 2005 18:19 GMT
Hi!
The JTree is in the window underneath it. I am using Java version 1.5.0_01-
b08 . I know something is wrong with my JBuilder or Java version because I
compiled code that my friends did and it there were errors (about Boolean
and Long). The code compiled on my friends' computers...
I will try to resolve the problem but if it doesn't work, I think I will
use your workaround.
If you have any other idea, don't hesitate!
Thanks a lot!
Marie
Marie - 29 Mar 2005 22:06 GMT
Hi!
I found the solution to my problem. The method called when I clicked on one
node my JTree was trying to delete all the nodes of the JTree. Now it
doesn't do that anymore.
Thanks for your help,
Marie