This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Applets and the fly likes AWT-EventQueue-5!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Applets
Bookmark "AWT-EventQueue-5!!!" Watch "AWT-EventQueue-5!!!" New topic
Author

AWT-EventQueue-5!!!

Sonal Sharma
Ranch Hand

Joined: May 13, 2006
Posts: 62
Dear all,
I am having a program that is creating this stack trace.Please help me out.
Thanks

My program is as following:

Exception in thread "AWT-EventQueue-5" java.lang.NullPointerException: String is null
at sun.java2d.SunGraphics2D.drawString(Unknown Source)
at AgentCallStatusApps.paint(AgentCallStatusApps.java:250)
at sun.awt.RepaintArea.paintComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
[ July 05, 2007: Message edited by: Ulf Dittmer ]
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
In which line does the exception occur? What is the value of the string you're trying to draw in that line?

}catch(Exception e){}
}catch (IOException e){ }
}catch (Exception e){ }

Ignoring exceptions is not generally a good idea, and definitely not here. You should put in place some proper error handling.

Note that I have added CODE tags around your code - they make reading it much easier. See UseCodeTags for more information.
[ July 05, 2007: Message edited by: Ulf Dittmer ]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: AWT-EventQueue-5!!!
 
It's not a secret anymore!