T
Timasmith
I have code that executes when focus leaves a text control.
Specifically I grab the text in the control at that time.
jTextField.addFocusListener(new FocusListener(){
public void focusGained(FocusEvent e) {
}
public void focusLost(FocusEvent e) {
// calls getText() and does something with it
}
});
However if I edit a text field and click on a button, swing does not
execute the focusLost - or if it does it is not with the new value.
It almost seems like a button lets me sneak out of the text control.
Specifically I grab the text in the control at that time.
jTextField.addFocusListener(new FocusListener(){
public void focusGained(FocusEvent e) {
}
public void focusLost(FocusEvent e) {
// calls getText() and does something with it
}
});
However if I edit a text field and click on a button, swing does not
execute the focusLost - or if it does it is not with the new value.
It almost seems like a button lets me sneak out of the text control.