-
Bug
-
Resolution: Fixed
-
P3
-
1.1.2, 1.1.5, 1.2.0
-
1.2.2
-
generic, x86, sparc
-
generic, solaris_2.6, windows_nt
Name: joT67522 Date: 09/16/97
The MenuItem class should also return the label of the menu item
in the ActionEvent if it is activated and if there is no
action command specified for it.
However, this is not the case, if the menu item is activated
through the menu shortcut.
I've went through the source code that is part of the JDK 1.1.3
and found the error in the method handleShortcut of the MenuItem
class. Instead of:
if (e.getID() == KeyEvent.KEY_PRESSED) {
Toolkit.getEventQueue().postEvent(
new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
actionCommand));
^^^^^^^^^^^^^
...
there should be:
if (e.getID() == KeyEvent.KEY_PRESSED) {
Toolkit.getEventQueue().postEvent(
new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
getActionCommand()));
^^^^^^^^^^^^^^^^^^
...
Keep on the good work!
company - HERMES SoftLab , email - ###@###.###
======================================================================
- duplicates
-
JDK-4052823 Action commands generated by MenuShortcut is null unless setActionCommand used
-
- Closed
-
-
JDK-4139636 MenuShortcut causes NullPointerException on ActionEvent.getActionCommand()
-
- Closed
-