- On Dec 12, 2009, at 3:01 PM, elias elias wrote:
- Hi every Body,
- i can easly add an action Listener to a JTextField so when I PUCH THE ENTER BUTTON in my Keyboard : a method is called to handel and Does something...
- But, i don't want ( when I PUCH THE ENTER BUTTON in my Keyboard)
- i Need instead to call the method each time i LEAVE the JTextField and go to another...
- in fact, i have 10 JTextFields and when i enter a text into any of them, i need once i leave it (go anywhere out of it) to call this function .....
- Many Thanks for Any help
- Subject: Re: JTextField tecknical Q
- From: email@hidden
- Date: Sat, 12 Dec 2009 15:28:52 -0600
- Delivered-to: email@hidden
- Delivered-to: email@hidden
|
I'd recommend using the focusLost() method of a FocusListener:
myTextField.addFocusListener( new FocusAdapter() {
public void focusLost(FocusEvent e) {
doSomething();
}
});
Regards,
- Jeremy
-------------------------
|
PERFECT, Jeremy
The above method works well when i leave the JTextField....Good, a similar need when i want to doSomething() Not when i leave the JTextField, but each time i TYPE (or Delete) a letter into this JTextField, so i can use it for searches purposes.... email@hidden
|
|
|