Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld >> Java Beginner

Pages: 1
verma
stranger


Reged: 01/25/08
Posts: 3
Exception at new Thread start
      #183854 - 09/10/08 04:36 AM

when I start new Thread then it throw an exception as


Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.text.JTextComponent.getSelectionStart(Unknown Source)
at javax.swing.text.PlainView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)



But application is working fine, but I want to handle this exception.
Any Solution yet?


Post Extras: Print Post   Remind Me!   Notify Moderator  
verma
stranger


Reged: 01/25/08
Posts: 3
Re: Exception at new Thread start [Re: verma]
      #183877 - 09/10/08 01:37 PM

I am trying to invoke two thread on the event of two different button.
both are accessing the same textArea on GUI, which have these two button.

and i define above when i click any of button then it throw above exception some time (not every time) but it does not effect the functionality of application.


Any idea please help


Post Extras: Print Post   Remind Me!   Notify Moderator  
hiwa
Carpal Tunnel


Reged: 06/21/03
Posts: 7704
Loc: Japan
Re: Exception at new Thread start [Re: verma]
      #184044 - 09/13/08 04:54 AM

Your text area is null at some point in your code.
If you need further help then you need to create a Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that could reproduce the error.

--------------------
*stop cruelty* Annual number of euthanized cats&dogs: US 5M, JP 500K.*for our better karma*


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating: *****
Topic views: 15180

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5