🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12037

Re: Urgent : Pb with Event Dispatching - very important

#12037
From: Emil Lefkof
Date: Thu, 25 Feb 1999 00:00
58 lines
2916 bytes
Make sure you have menu items in the MenuBar.  i was having the same
problem.  As soon as you have menu items with in the menubar this exception
goes away.  Don't ask me why.

Hope it helps.
    Anne JANSSENS wrote in message <79v54o$jfk12@forums.borland.com>...
    Here is my problem :

    I have a Jframe with a JMenuBar and at the center, I have a JPanel in
witch I have add some JTextField.

    I have implemented a keyListener for each JTextField, I do some stuff in
the keyPressed method,
    and I call evt.consume()

    I have this message that appears and nothing is done in my keyPressed
method :

    Exception occurred during event dispatching:
    java.lang.NullPointerException
     at com.sun.java.swing.JMenuBar.bindingForKeyStrokeRecursive(Compiled
Code)
     at com.sun.java.swing.JMenuBar.bindingForKeyStroke(Compiled Code)
     at com.sun.java.swing.JComponent.processKeyBinding(Compiled Code)
     at
com.sun.java.swing.JComponent.processKeyBindingsForAllComponents(Compiled
Code)
     at
com.sun.java.swing.JComponent.processKeyBindingsForAllComponents(Compiled
Code)
     at
com.sun.java.swing.JComponent.processKeyBindingsForAllComponents(Compiled
Code)
     at
com.sun.java.swing.JComponent.processKeyBindingsForAllComponents(Compiled
Code)
     at com.sun.java.swing.JComponent.processKeyBindings(Compiled Code)
     at com.sun.java.swing.JComponent.processKeyEvent(Compiled Code)
     at java.awt.Component.processEvent(Compiled Code)
     at java.awt.Container.processEvent(Compiled Code)
     at java.awt.Component.dispatchEventImpl(Compiled Code)
     at java.awt.Container.dispatchEventImpl(Compiled Code)
     at java.awt.Component.dispatchEvent(Compiled Code)
     at java.awt.LightweightDispatcher.processKeyEvent(Compiled Code)
     at java.awt.LightweightDispatcher.dispatchEvent(Compiled Code)
     at java.awt.Container.dispatchEventImpl(Compiled Code)
     at java.awt.Window.dispatchEventImpl(Compiled Code)
     at java.awt.Component.dispatchEvent(Compiled Code)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)


    I'am not sure but I think it is a focus problem because a focus listener
is called before the keyListener !

    Can anyone help me, it's very important for my work, and with this
message I don't see what is wrong !

    Thanks a lot for your help, :)Anne
Technical Details
Message-ID: <7b43uq$edu13@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <79v54o$jfk12@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,d6bf8cb297d566b0
X-Google-Attributes: gid111d45,public
From: "Emil Lefkof" <elefkof@fcg.com>
Subject: Re: Urgent : Pb with Event Dispatching - very important
Date: 1999/02/25
Message-ID: <7b43uq$edu13@forums.borland.com>
X-Deja-AN: 448405126
References: <79v54o$jfk12@forums.borland.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing