Article View: borland.public.jbuilder.java.swing
Article #10385Re: "Mnemonic-key" appears in JTextField
From: Alex
Date: Mon, 20 Sep 1999 00:00
Date: Mon, 20 Sep 1999 00:00
26 lines
1320 bytes
1320 bytes
Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no> wrote in message
news:uhfl346t7.fsf@sds.no...
> [...]
> Workaround is to add a KeyListener which eats it.
Hello Tor,
Thank you very much for your reply !
Could you please give me a short example how to "eat the KeyEvent" ?
My problem is: I know how to write a KeyListener that is called when a key
is pressed (released / typed) but what does the listener have to do to stop
the textField from adding the new letter to the text ?
textField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(KeyEvent e) {
// I think this is the place to do something very smart, isnοΏ½t it ?
// the Question is: WHAT ?
}
});
Technical Details
Message-ID:
<7s68an$bnd14@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7r8pk9$8k014@forums.borland.com> <uhfl346t7.fsf@sds.no>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,d2655702133b60a3 X-Google-Attributes: gid111d45,public From: "Alex" <alexbged@linux.zrz.tu-berlin.de> Subject: Re: "Mnemonic-key" appears in JTextField Date: 1999/09/20 Message-ID: <7s68an$bnd14@forums.borland.com> X-Deja-AN: 527582578 References: <7r8pk9$8k014@forums.borland.com> <uhfl346t7.fsf@sds.no> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing