Article View: borland.public.jbuilder.java.language
Article #18149How to get the current textfield value when typing
From: Michael Mitiaguin
Date: Fri, 31 Jul 1998 00:00
Date: Fri, 31 Jul 1998 00:00
27 lines
1237 bytes
1237 bytes
Hello ,
I'd like to get the current Swing textfield value after each keystroke.
For the fragment which is given below I have one symbol delay. For
instance after typing "12" getText returns "1".
jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(KeyEvent e) {
jTextField1_keyTyped(e);
}
});
void jTextField1_keyTyped (KeyEvent e) {
System.out.println ( jTextField1.getText() ) ;
}
Thanks.
--------------------------------------------------------------------
Michael Mitiaguin
Software Engineer
Digerati
Email: michael@digerati.com.au
--------------------------------------------------------------------
Technical Details
Message-ID:
<35C11376.2E0C2ABB@digerati.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,2f375eb33ec1da49,start X-Google-Attributes: gidf74b3,public From: Michael Mitiaguin <michael@digerati.com.au> Subject: How to get the current textfield value when typing Date: 1998/07/31 Message-ID: <35C11376.2E0C2ABB@digerati.com.au> X-Deja-AN: 376519088 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language