This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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