Re: focusLost vs. actionPerformed



Fred Kleinschmidt wrote:
"Richard F.L.R.Snashall" <rflrs@xxxxxxxxxxxxx> wrote in message


Popping a error/warning dialog on FocusLost is usually a *bad idea*.
The problem is that the user starts entering the info, then realizes she
has to look elsewhere to view information necessary to input the
correct info. But when she tries that, bang! - you force thiis dialog
up, she acknowledges it, and you send focus back to the offending
text field. Then she tries to go elsewhere to find the info, and you pop up
the dialog again. She in frustration then abandons anything to do with
that program.

In its present state, I do not force the focus back to the offending
component. I basicly ignore the bad input by putting the good value
back. This does not allow the user to just edit it to a good value,
but it does preclude the problem above.

However, if I don't check the input when focus is lost, (or do you
have an alternative), it could sit there in a poor state with no
message to the user. Wouldn't that be just as poor?

That still leaves the original question. Is it a property of my
machine that the loss of focus is acted upon before the other
actionPerformed process has completed, or would that happen on all
platforms?
.