Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Null pointer exception.....  RSS feed

 
Prashanth Sivarajan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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()?
 
Prashanth Sivarajan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes if the thread that invokes the code is not evenDispatchThread I use the invokeLater()
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!