This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How do you add a keylistener to JCTextField. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How do you add a keylistener to JCTextField." Watch "How do you add a keylistener to JCTextField." New topic
Author

How do you add a keylistener to JCTextField.

Pankaj Tendulkar
Greenhorn

Joined: Jan 11, 2005
Posts: 5
How do you add a keylistener to JCTextField.JCTextField is a component in the JClass API.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302
    
    6

Well, if it's anything like a JTextField, you use the addKeyListener method. You can add a KeyAdapter so that you only have to implement the method(s) you need or you can add a new KeyListener and implement all the methods.



GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do you add a keylistener to JCTextField.
 
It's not a secret anymore!