wood burning stoves
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes buttons, mnemonics, dialogs and frames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "buttons, mnemonics, dialogs and frames" Watch "buttons, mnemonics, dialogs and frames" New topic

buttons, mnemonics, dialogs and frames

Ronald Wouters
Ranch Hand

Joined: Apr 28, 2005
Posts: 190
Hi all,

the Java Look and Feel design guidelines state that the default command button of a top level container (JFrame, JDialog) and also the cancel/exit button should not have keyboard mnemonics.
Suppose you have a File|Exit menu item and an Exit command button.
I setup an Action (extends from AbstractAction) for both the menu item and the exit button. I also setup a mnemonic for the Action by using the method putValue(MNEMONIC_KEY, KeyEvent.VK_X).
The problem is that now both the menu item and the exit command button have a mnemonic, while according to the L&F guidelines the exit button shouldn't !
How do you suggest to solve this dilemma ?

Regards, Ronald.

Sun Certified Developer for the Java 2 Platform
Sun Certified Enterprise Architect for the Java Platform, Enterprise Edition 5
wood burning stoves
subject: buttons, mnemonics, dialogs and frames
It's not a secret anymore!