Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4188844

problem with JMenu.remove( JMenuItem)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs
    • 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)
      ======================================================================

            gsaab Georges Saab
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: