aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Null pointer exception..... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Null pointer exception....." Watch "Null pointer exception....." New topic
Author

Null pointer exception.....

Prashanth Sivarajan
Greenhorn

Joined: May 15, 2007
Posts: 7
I get the following exception when a JFrame is opened with a number of text boxes and combboxes.....

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.JComponent._paintImmediately(JComponent.java:5085)
at javax.swing.JComponent.paintImmediately(JComponent.java:4880)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:723)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


I can't post the actual code of the JFrame....the application runs in Solaris. Please let me know if anyone else faced this problem and if there is any solution.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Originally posted by Prashanth Sivarajan:
I get the following exception when a JFrame is opened with a number of text boxes and combboxes.....

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.JComponent._paintImmediately(JComponent.java:5085)


Difficult to say much based on this.
Are you using SwingUtilities.invokeLater()?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Prashanth Sivarajan
Greenhorn

Joined: May 15, 2007
Posts: 7
yes if the thread that invokes the code is not evenDispatchThread I use the invokeLater()
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Null pointer exception.....