aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Probelm with KeyListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Probelm with KeyListener" Watch "Probelm with KeyListener" New topic
Author

Probelm with KeyListener

seema prakash
Ranch Hand

Joined: Nov 17, 2004
Posts: 59
I have a JTextField and a JCheckBox. I want the JCheckBox
to be enabled only when the JTextField is not empty.
I have implemented the KeyListener for the JTextField.
But, only when the second character is entered in the JTextField
the Listener seems work. Please help.

seema prakash
Ranch Hand

Joined: Nov 17, 2004
Posts: 59
I got it working ! I should have written the code in the KeyReleased method instead of the KeyTyped.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Probelm with KeyListener