CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2000
    Posts
    22

    Exception help Phill,poochi,unciman

    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..







  2. #2
    Join Date
    Sep 2000
    Location
    Melbourne --> Australia
    Posts
    68

    Re: Exception help Phill,poochi,unciman

    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
    [email protected]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured