Detecting JTextField “deselect” event
问题 Is there some way to detect if a JTextField is deselected, i.e. the field WAS selected but now you have selected something else. The reason why I want to do this is because I want to check my users forms for any illegal characters before they try to submit their data. If there is some easier way to do that, instead of the way I'm trying to solve it, I'll gladly accept enlightenment. 回答1: At first though use a FocusAdapter and override focusLost(FocusEvent fe) which will be called when