The basic problem with the above combination is that JButtons
actionPerformed is executed even if some InputVerifier to some component
objects. That may (and in fact does) to storing of invalid data in some
cases.

As a comment to the above bug states, the main reason for this behaviour
is that in BasicButtonListener mousePressed the state of the buttonModel
is set to armed and pressed _before_ requesting the focus to the button.

Some experiments showed that the only reliable way to prevent it and
leave the button in a consistent state is to reverse the order of calls:
first request the focus and then if the button actually received it go
ahead and change the state. (Every of the other suggested workarounds at
least lead to an unconsistent state of "half-pressed": button looks
pressed whenever the mouse enters).

Now the question:

Does any of you see any deeper reason to have the sequence of method
calls as is? Would there be any hidden inconsistencies? To solve the
problem would require to reverse the order in the keybindings to
mnemonic, default button handling as well... :-(

Any comments/ideas?

Jeanette

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to