Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2005

Tip: Looking for answers? Try searching our database.

exception in at javax.swing.SwingGraphics.createSwingGraphics

Thread view: 
jobs239@hotmail.com - 19 Jul 2005 19:41 GMT
I am getting the following exception sometimes in my GUI. How can I
debug this? There is nothing from my code in the stack and the
exception is not easily reproducible. Any help will be greatly
appreciated.

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
Mathias Lichtner - 19 Jul 2005 20:24 GMT
> I am getting the following exception sometimes in my GUI. How can I
> debug this? There is nothing from my code in the stack and the
> exception is not easily reproducible. Any help will be greatly
> appreciated.

[...]
> 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?
Thomas Fritsch - 20 Jul 2005 01:18 GMT
>I am getting the following exception sometimes in my GUI. How can I
> debug this? There is nothing from my code in the stack and the
[quoted text clipped - 6 lines]
> at javax.swing.JComponent._paintImmediately(JComponent.java:4670)
> ...

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.

Signature

"TFritsch$t-online:de".replace(':','.').replace('$','@')



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.