Hi all, I have an application with numerous JTextFields and JComboBoxes, and need to perform validation on the JTextFields to confirm that the entry is a valid number, within the defined range, etc. I use a KeyListener and FocusListener for this, and it works fine as long as I just navigate using the tab key. Things get strange however, when there is an invalid entry in one of the JTextFields, and the user selects one of the JComboBoxes with the mouse. The JOptionPane with the error message pops up and the focus is returned to the original JTextField when the user hits the "okay" button, as it should be. The problem is that the popup window from the JComboBox I tried to select is still shown. This is despite the fact that the caret is back in the original JTextField. I have to click somewhere on the panel to get the popup window to close. I would have thought that the focusGained event would fire on the JComboBox (how else would it know to display the popup?), but this doesn't happen. I've tried println statements everywhere in the possible JComboBox's events, but nothing seems to fire. Once I can determine which event fires, then it should be simple to use the hidePopup() method to close the popup. What am I missing here? The code below is taken from the focusLost event in the FocusListener I use with the JTextFields. I'm wondering if the way I'm displaying this error message may be the problem.
Any suggestions would be greatly appreciated. Thanks, Al [This message has been edited by Al Heinrichs (edited June 17, 2001).]