SUGGESTED FIX
Suggest adding a constant such as MNEMONIC_INDEX_KEY, optional of course, type int, corresponding to AbstractButton.displayedMnemonicIndex, and editing AbstractButton.configurePropertiesFromAction accordingly.
NetBeans has already dealt with this issue:
http://www.netbeans.org/source/browse/~checkout~/openide/src/org/openide/awt/Actions.java
http://www.netbeans.org/source/browse/~checkout~/openide/src/org/openide/awt/Mnemonics.java
If you create an action with an ampersand in the name before a letter, that letter is given a mnemonic, and it will be correctly placed if you are using JDK 1.4. Non-Latin scripts are supported in 1.4 as well, using a translation table mapping characters to keystrokes.
Thus in NetBeans code it is discouraged to do this:
Action a;
JMenuItem mi = new JMenuItem();
mi.setAction(a);
jPopupMenu.add(mi);
you need to do this:
Action a;
JMenuItem mi = new JMenuItem();
Actions.connect(mi, a, true);
jPopupMenu.add(mi);
###@###.### 2003-03-26
|