Click to See Complete Forum and Search --> : Exception help Phill,poochi,unciman


rajaraj
October 6th, 2000, 10:42 PM
i have a joptionpane that comes on a click of a button over a jtextarea.
when i click on the optionpane with a mouse it throws an exception like this..Exception occurred during event dispatching:java.lang.NullPointerException: null pData at sun.awt.windows.WInputMethod.handleNativeIMEEvent(Native Method) at sun.awt.windows.WInputMethod.dispatchEvent(WInputMethod.java:256) at sun.awt.im.InputContext.dispatchEvent(InputContext.java:173) at sun.awt.im.InputMethodContext.dispatchEvent(InputMethodContext.java:180) at java.awt.Component.dispatchEventImpl(Component.java:2473) at java.awt.Container.dispatchEventImpl(Container.java:1302) at java.awt.Component.dispatchEvent(Component.java:2443) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2504) at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:2366) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2261) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2191) at java.awt.Container.dispatchEventImpl(Container.java:1289) at java.awt.Window.dispatchEventImpl(Window.java:854) at java.awt.Component.dispatchEvent(Component.java:2443) at java.awt.EventQueue.dispatchEvent(EventQueue.java:302) at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:95) at
java.awt.EventDispatchThread.run(EventDispatchThread.java:86)



but,when i use the tab key move the focus to the button in the optionpane and use the spacebar in the keyboard to click the button, it works fine.

please help me. i have a mouselistener on the textarea..

Phill
October 7th, 2000, 05:13 PM
Hi
Its hard for me to tell without viewing
your code.
Somthing is not initialized and still has
a "null" value.
This can happen when you declare a variable
at the top of your file and then later in the code
initialize it in a method, but if that method isnt
called before the mouse event takes place, you
will receive a null pointer exception.
You can email the code to me or post it here
if you like, then its easier to help.
Good luck Phill
kashmir@zip.com.au