At 10:03 AM 6/12/2001 -0700, ravi prakash wrote:
>Hi,
>
>I am trying to capture events Ctrl+Alt+a, i had went through the forums
>and i haven't found a solution for this, Could any help me in this with
>sample code
The most straightforward method is to create a JMenuItem, and set
its accelerator (with setAccelerator(), aptly enough). The method
takes a KeyStroke object, which you can obtain by calling the
static method KeyStroke.getKeyStroke() with the appropriate
parameters.
If you don't want to create a JMenuItem (usability-wise, having a
menu item is a good idea in general), you can use the method
registerKeyboardAction(), invoked on the JComponent of interest.
Again, this method takes a KeyStroke object, as well as an
ActionListener and one other argument.
BTW, please post questions to either [EMAIL PROTECTED] or
[EMAIL PROTECTED], but not both. Thank you.
_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing