🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Urgent : Pb with Event Dispatching - very important

#12194
From: Anne JANSSENS
Date: Thu, 11 Feb 1999 00:00
142 lines
6225 bytes
Message en plusieurs parties et au format MIME.

------=_NextPart_000_007B_01BE55EF.9E84CA80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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()=20

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


------=_NextPart_000_007B_01BE55EF.9E84CA80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY>
<DIV><FONT size=3D2>Here is my problem :</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I have a Jframe with a JMenuBar and a</FONT><FONT =
size=3D2>t the=20
center, I have a JPanel in witch I have add some =
JTextField.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I have implemented a keyListener for each =
JTextField, I do=20
some stuff in the keyPressed method,</FONT></DIV>
<DIV><FONT size=3D2>and I call evt.consume() </FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I have this message that appears and =
nothing is=20
done in my keyPressed method :</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>Exception occurred during event=20
dispatching:<BR>java.lang.NullPointerException<BR>&nbsp;at=20
com.sun.java.swing.JMenuBar.bindingForKeyStrokeRecursive(Compiled=20
Code)<BR>&nbsp;at =
com.sun.java.swing.JMenuBar.bindingForKeyStroke(Compiled=20
Code)<BR>&nbsp;at =
com.sun.java.swing.JComponent.processKeyBinding(Compiled=20
Code)<BR>&nbsp;at=20
com.sun.java.swing.JComponent.processKeyBindingsForAllComponents(Compiled=
=20
Code)<BR>&nbsp;at=20
com.sun.java.swing.JComponent.processKeyBindingsForAllComponents(Compiled=
=20
Code)<BR>&nbsp;at=20
com.sun.java.swing.JComponent.processKeyBindingsForAllComponents(Compiled=
=20
Code)<BR>&nbsp;at=20
com.sun.java.swing.JComponent.processKeyBindingsForAllComponents(Compiled=
=20
Code)<BR>&nbsp;at =
com.sun.java.swing.JComponent.processKeyBindings(Compiled=20
Code)<BR>&nbsp;at com.sun.java.swing.JComponent.processKeyEvent(Compiled =

Code)<BR>&nbsp;at java.awt.Component.processEvent(Compiled =
Code)<BR>&nbsp;at=20
java.awt.Container.processEvent(Compiled Code)<BR>&nbsp;at=20
java.awt.Component.dispatchEventImpl(Compiled Code)<BR>&nbsp;at=20
java.awt.Container.dispatchEventImpl(Compiled Code)<BR>&nbsp;at=20
java.awt.Component.dispatchEvent(Compiled Code)<BR>&nbsp;at=20
java.awt.LightweightDispatcher.processKeyEvent(Compiled =
Code)<BR>&nbsp;at=20
java.awt.LightweightDispatcher.dispatchEvent(Compiled Code)<BR>&nbsp;at=20
java.awt.Container.dispatchEventImpl(Compiled Code)<BR>&nbsp;at=20
java.awt.Window.dispatchEventImpl(Compiled Code)<BR>&nbsp;at=20
java.awt.Component.dispatchEvent(Compiled Code)<BR>&nbsp;at=20
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)</FONT></DIV=
>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I'am not sure but I think it is a focus problem =
because a=20
focus listener is called before the keyListener !</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Can anyone help me, it's very important for my work, =
and with=20
this message I don't see what is wrong !</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Thanks a lot for your help, :)Anne</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_007B_01BE55EF.9E84CA80--
Technical Details
Message-ID: <79v54o$jfk12@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,d6bf8cb297d566b0,start
X-Google-Attributes: gid111d45,public
From: "Anne JANSSENS" <recherche@generix.fr>
Subject: Urgent : Pb with Event Dispatching - very important
Date: 1999/02/11
Message-ID: <79v54o$jfk12@forums.borland.com>
X-Deja-AN: 443283852
Content-Type: multipart/alternative; boundary="----=_NextPart_000_007B_01BE55EF.9E84CA80"
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing