-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
1.4.1, 1.4.2
-
x86
-
windows_2000
Name: gm110360 Date: 09/23/2002
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
This is an RFE for an API change, but since you ask...
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
When the displayedMnemonicIndex was added
to AbstractButton, no provision was made
for configuring it with Actions.
Here's a comment I wrote for bug 4138746:
If AbstractButton is going to have this this
new 'displayedMnemonicIndex' property, then
it should be supported by the Action interface.
For example:
Action a = new AbstractAction() {
putValue(NAME, "Save As...");
putValue(SMALL_ICON, new ImageIcon(icons/saveas.gif));
putValue(MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
putValue(DISPLAYED_MNEMONIC_INDEX, new
Integer(5)); // <----- need to be able to do this
putValue(SHORT_DESCRIPTION, "Save to a new file
name");
// could also set values for ACTION_COMMAND_KEY
and ACCELERATOR_KEY
setEnabled(true);
};
JButton saveAsButton = new JButton(a);
JMenuItem saveAsMenuItem = new JMenuItem(a);
Of course the real work in implementing this will
be in AbstractButton and its subclasses. Action
only needs only a new key for the property.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER WORKAROUND :
Work arounds are tough unless you're
willing to create one's buttons/menus
without using Actions.
(Review ID: 164827)
======================================================================
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
This is an RFE for an API change, but since you ask...
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
When the displayedMnemonicIndex was added
to AbstractButton, no provision was made
for configuring it with Actions.
Here's a comment I wrote for bug 4138746:
If AbstractButton is going to have this this
new 'displayedMnemonicIndex' property, then
it should be supported by the Action interface.
For example:
Action a = new AbstractAction() {
putValue(NAME, "Save As...");
putValue(SMALL_ICON, new ImageIcon(icons/saveas.gif));
putValue(MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
putValue(DISPLAYED_MNEMONIC_INDEX, new
Integer(5)); // <----- need to be able to do this
putValue(SHORT_DESCRIPTION, "Save to a new file
name");
// could also set values for ACTION_COMMAND_KEY
and ACCELERATOR_KEY
setEnabled(true);
};
JButton saveAsButton = new JButton(a);
JMenuItem saveAsMenuItem = new JMenuItem(a);
Of course the real work in implementing this will
be in AbstractButton and its subclasses. Action
only needs only a new key for the property.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER WORKAROUND :
Work arounds are tough unless you're
willing to create one's buttons/menus
without using Actions.
(Review ID: 164827)
======================================================================
- duplicates
-
JDK-4133141 Extend Action interface to handle toggles
- Resolved