-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
generic, x86
-
generic, windows_nt
Name: rk38400 Date: 11/10/98
the method JMenu.remove( JMenuItem item ) assumes that the menu item specified by 'item' was added to the menu using
the method JMenu.add( Action a ).
this assumption is made since it always looks for item in the listenerRegistry hash table, but it will only be in this collection
when added with the second form of add().
furthermore, the lines 582-584 in JMenu.java are wrong (JMenu.java that comes with the jdk1.2 rc1 release).
if you look at the way JMenu.add( Action a ) adds key/value pairs in listenerRegistry, you see that it maps item->action
and action-> actionPropertyChangeListener, whereas the code in remove() tries to get actionPropertyChangeListener from
mi and action from actionPropertyChangeListener.
(Review ID: 42316)
======================================================================
- duplicates
-
JDK-4188847 JMenu.remove(JMenuItem item) throws exception
- Closed
-
JDK-4169490 JMenu's method remove(JMenuItem mi) throws NPE
- Resolved