verma
stranger
Reged: 01/25/08
Posts: 3
|
|
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?
|
verma
stranger
Reged: 01/25/08
Posts: 3
|
|
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
|
hiwa
Carpal Tunnel
Reged: 06/21/03
Posts: 7704
Loc: Japan
|
|
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*
|