Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to distinguish between KeyEvent and ActionEvent

843807Jan 24 2002 — edited Feb 19 2002
Hi
I have a JMenuItem who actionComand has a AbstractAction. I have also mapped CRTL Key to it by setting Accelerator. Now when the user pulls down the menu it should behave differently, than when control key is used.
But right now for both the ways it works the same way.
In short in ActionPerformed method can I distinguish whether control key was pressed or menu Item was used.

Thanks in Advance
VY
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 19 2002
Added on Jan 24 2002
8 comments
302 views