...
>I am using jdk1.5 Kit for application development. I am using AWT for
>gui interface making.
Why are you coding AWT GUI's to run in Java 1.5?
Swing would be the far more common option in
this millennium.
>..Can you please guide me, how I can define
>shortcut of menu like Alt+F?
Did you try RTFM, or are you simply coding by
typing random statemenets into the IDE?
>I tried below statement for define shortcut of menu but it works on
>Ctrl key.
Yes. As the FM describes.
>Please guide me, how we can control menu using Alt key? Is it possible
>in AWT?
Sure. Try reading the FM. Start with that clue to
'KeyEvent' in the constructor for the 'MenuShortcut'.
<http://java.sun.com/javase/6/docs/api/java/awt/event/KeyEvent.html#KeyEvent(java
.awt.Component,%20int,%20long,%20int,%20int,%20char
)>

Signature
Andrew Thompson
http://www.athompson.info/andrew/
AimsLife - 13 Sep 2007 11:34 GMT
Hi,
> >I am using jdk1.5 Kit for application development. I am using AWT for
> >gui interface making.
>
> Why are you coding AWT GUI's to run in Java 1.5?
> Swing would be the far more common option in
> this millennium.
I am using some third party controls and they are using AWT, thats
why, I am developing gui in one type of components.
I need to define short key on Menu not Menu Item. Please tell me, the
way to define acceleration on menu.
Regards,
-aimslife
>fileMenuItemOpen.setShortcut(new MenuShortcut(KeyEvent.VK_F));
menuItem = new JMenuItem("A text-only menu item",
KeyEvent.VK_T);
menuItem.setAccelerator(KeyStroke.getKeyStroke(
KeyEvent.VK_1, ActionEvent.ALT_MASK));

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com