Mega Code Archive

 
Categories / Java Tutorial / Swing Event
 

AbstractAction Lookup Property Keys

One complexity-busting side effect when using AbstractAction is that it lets you disable the Action with setEnabled(false), which, in turn, will disable all components created from it. ConstantDescription NAMEAction name, used as button label SMALL_ICONIcon for the Action, used as button label SHORT_DESCRIPTIONShort description of the Action; could be used as tooltip text, but not by default LONG_DESCRIPTIONLong description of the Action; could be used for accessibility (see Chapter 22) ACCELERATORKeyStroke string; can be used as the accelerator for the Action ACTION_COMMAND_KEYInputMap key; maps to the Action in the ActionMap of the associated JComponent MNEMONIC_KEYKey code; can be used as mnemonic for action DEFAULTUnused constant that could be used for your own property