Re: How to add Accelerator key for UndoAction/RedoAction on menu?
Posted By:
Dave_Hewitson
Posted On:
Friday, August 16, 2002 02:28 AM
undoMenuItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.ActionEvent.CTRL_MASK));
....In your example, CTRL-Z will invoke whatever code runs when the undo menu option is selected.
Change the Virtual Key (VK_???) to add accelerator for Redo.
You can also have different modifiers, such as Alt or whatever.
Is this what you mean?
Dave