File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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


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.

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(
at sun.awt.RepaintArea.paintComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at 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 Source)
[ July 05, 2007: Message edited by: Ulf Dittmer ]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
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 agree. Here's the link:
subject: AWT-EventQueue-5!!!
It's not a secret anymore!