java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1064)
at
javax.swing.SwingGraphics.createSwingGraphics(SwingGraphics.java:147)
at javax.swing.JComponent._paintImmediately(JComponent.java:4670)
at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
java.lang.NullPointerException
at javax.swing.JComponent._paintImmediately(JComponent.java:4671)
at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
In paintImmediately null graphics
[...]
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
> In paintImmediately null graphics
>
last line, 'In paintImmediately null graphics', perhaps you have
modified your 'Graphics' in an overridden method like paintComponent
or modified it somewhere else?
It's an old non-public implementation class. We can deduce that hiwa is
not using Java 5.0.
Looks like a getGraphics is returning null at a guess. That would mean
trying to paint a Component that isn't displayed.
A quick search of the bug parade brings up
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5004059
"JComponent.paintImmediately() always prints stack trace for NPE"
The title refers to the two stack traces presented in the initial
posing. Last evaluation says
"It was determined this exception is stemming from customer removing a
component from the containment hierarchy on another thread, something we
don't allow. Customer will be fixing their application. None-the-less
JComponent should not being eating this exception and we will change that."
So, is the original poster breaking Swing's threading rules? The stack
trace with line numbers is all very nice, but which version does this
correspond to? Any chance of more details, such as a small,
demonstrating example?
Tom Hawtin
--
Unemployed English Java programmer
Take a look at the source (in "src.zip" of your JDK installation) of
Thread.dumpStack()
/**
* Prints a stack trace of the current thread. This method is used
* only for debugging.
*/
public static void dumpStack() {
new Exception("Stack trace").printStackTrace();
}
You see, that the Exception is *not* thrown. It is just created to print a
stack trace, and the method returns normally. (May be some developer of the
SwingGraphics class has "forgotten" to remove a debugging line
"Thread.dumpStack();" before that JDK version was released.) So there is no
problem at all, and you can safely ignore it.
Of course, in your IDE-debugger you could set a breakpoint on
Thread.dumpStack() to see under which circumstances it happens. But I think
it is not worth the effort.
--
"TFritsch$t-online:de".replace(':','.').replace('$','@')