-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.1.1
-
x86
-
windows_95
Name: mc57594 Date: 06/10/97
There's a bug in java.awt.MenuItem.java line 229.
Instead of returning "actionCommand" you should return
getActionCommand() in the action event since "actionCommand"
may not have been set and may be null (in which case it should
return the label -- like in getActionCommand()).
---------------------------------------------------
[chamness 6/10/97] The described code in MenuItem.java is listed.
(8th line from the bottom.)
/*
* Post an ActionEvent to the target (on
* keydown). Returns true if there is an associated
* shortcut.
*/
boolean handleShortcut(KeyEvent e) {
MenuShortcut s = new MenuShortcut(e.getKeyCode(),
(e.getModifiers() & InputEvent.SHIFT_MASK) > 0);
if (s.equals(shortcut) && enabled) {
// MenuShortcut match -- issue an event on keydown.
if (e.getID() == KeyEvent.KEY_PRESSED) {
Toolkit.getEventQueue().postEvent(
new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
actionCommand));
} else {
// silently eat key release.
}
return true;
}
return false;
}
======================================================================