I’m writing a fairly simple IDE for developing embedded programs (for iRobot’s Create platform) and almost every single button and menu item is backed by Java’s Action system.
This has made it easier to handle all the operations that the user will want without duplicating an operation’s trigger.
What I would like to know is, how do I disable the JButtons and JMenuItems created from an Action by disabling the Action itself?
In case it helps, I’ve written an Action-wrapping class that allows me to easily create a JButton or JMenuItem straight from the Action itself, which means I have hooks in place already to add stuff to the buttons or menu items should the need arise.
Any suggestions?
Short answer:
anAction.setEnabled( false );Shorter answer:
http://sscce.org/