Article View: borland.public.jbuilder.java.api
Article #3621Re: processKeyEvent
From: Greg Hamer
Date: Wed, 29 Oct 1997 00:00
Date: Wed, 29 Oct 1997 00:00
27 lines
1264 bytes
1264 bytes
I believe that is what the .consume() method is for, as in
void processKeyEvent(KeyEvent e) {
e.consume();
super.processKeyEvent(e);
}
This will stop the parent container(s) from seeing the event.
Stuart Morse wrote:
> Hi All,
>
> Today I extended the regular awt TextField object in order to
> overload the TextField's processKeyEvent method. This allowed
> me to trap key stroke events and act on them. However it appears
> that unless you call super.processKeyEvent somewhere in your
> new method the event gets passed up to the super object and is
> processed anyway. This appears similar to the behaviour under
> java 1.0.X when an overloaded event handling method returned
> false.
>
> I would like to avoid passing the event to the super object under
> certain circumstances. Any ideas?
>
> Stuart Morse
Technical Details
Message-ID:
<34581A87.22B7090C@borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34500414.DEECA1EE@cpsc.ucalgary.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,1e901428f2453de0 X-Google-Attributes: gid1089d0,public From: Greg Hamer <ghamer@borland.com> Subject: Re: processKeyEvent Date: 1997/10/29 Message-ID: <34581A87.22B7090C@borland.com> X-Deja-AN: 285895548 References: <34500414.DEECA1EE@cpsc.ucalgary.ca> X-Priority: 3 (Normal) Organization: None Newsgroups: borland.public.jbuilder.java.api