dcsimg
How to add Accelerator key for UndoAction/RedoAction on menu?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jeffrey_rui
Posted On:   Thursday, August 15, 2002 07:43 PM

For example:ctrl+Z

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
About | Sitemap | Contact