JButton question
You can ignore button clicks in the ActionListener if the flag is set; however, you shouldn't disable a button without showing it as disabled: it only confuses the users of your application.
a source to share
I suggest installing ButtonModel
with setArmed
and overrides setPressed
. Exactly how you override this depends on what you want it to do - for example if it is clicked, clicked, for example? Install ButtonModel
only once at a time JButton
. Add or reset the state to ButtonModel
to indicate how you want it to behave at any time.
Obviously, graphical interfaces with non-standard behavior can be confusing for users.
a source to share