Enabling and Disabling of Components Which Share an Action
by, 04-26-2012 at 07:50 PM (680 Views)
When “enabled”, the bound property of Action is enabled/disabled, property change event is sent to property change listeners. The AbstractButton consist of “inner-class property change listener” that disables/enables the correspondent component.
In case of ActionDemo applications, actions get initialized in initActions() method. Similar Actions set is shared among popup menu, toolbar, menu and also are used for construction of the UI controls in createPopupMenu(),createToolBar() and createMenu() methods.
Checkbox “enabled all actions” & ItemListener class which is anonymous constructed in method createPanel() enable or disable actions in actual. It will be altering state automatically so that to show off the present state of the action.