Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

Get new comments by email
You can cancel email alerts at anytime.
Comments (2)

Hemanth in Singapore, Singapore

80 months ago

I am getting the following exception when I am running my Swing Application. But the program continues and does not terminate abruptly unlike general Exceptions

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.plaf.basic.BasicTreeUI.paintRow(BasicTreeUI.java:1399)
at javax.swing.plaf.basic.BasicTreeUI.paint(BasicTreeUI.java:1189)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
at javax.swing.JComponent.paintComponent(JComponent.java:742)
at javax.swing.JComponent.paint(JComponent.java:1005)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
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)

How do I avoid this exception. What would be the cause for such an exception

- Was this comment helpful? Yes / No Reply - Report abuse

Hen in Reading, United Kingdom

76 months ago

Exceptions on the EDT do not crash applications. The EDT will start running and processing jobs if/when the EventQueue has new jobs to process.
As for your exception why don't you just set your debugger to stop when it hits NullPointerExceptions..

- Was this comment helpful? Yes / No (11) Reply - Report abuse

» Sign in or create an account to comment on this topic.