TiTi Guest
|
Posted: Fri Sep 26, 2003 11:23 am Post subject: Strange behaviour when showing dialog in focusLost handler |
|
|
Hi,
I wrote a FocusListener for a component that does input validation (in
focusLost method). If the input is invalid, the listener shows a dialog
(JOptionPane.showDialog()) and returns the focus to that component
(JComponent.requestFocus()).
Now a description of the problem. Suppose the component has an invalid
entry, and a user clicks to a button. This causes a focusLost event, which
validates the input. The input is incorrect, a dialog is shown and the focus
is returned. However, if I move my mouse cursor over the button I pressed,
it lights up with a color as if it were being pressed.
How can I prevent such behaviour?
Thanks,
Tom.
(PS: The same behaviour occurs when the input validation is done using an
InputVerifier).
|
|