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

JComboBox.removeAllItems() doesn't clear editor when empty

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • client-libs
    • beta
    • generic
    • generic



      Name: boT120536 Date: 03/13/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      I noticed all of the following closed bugs complain about the Array Index
      Exceptions that were thrown when trying to call removeAllItems() on an empty
      JComboBox.

        Bug ID: 4203314 JComboBox will throw IndexOutOfBoundsException
                      when removeAllItems() is called
        Bug ID: 4138253 JComboBox removeAllItems causes exception
        Bug ID: 4178928 JComboBox removeAllItems still throwing exception
        Bug ID: 4167850 (DLSM bug?) JComboBox.removeAllItems execptions
                      on empty list

        Unfortunately, it seems that in fixing that issue, a new bug was created in
      editable JComboBox objects in which the JTextField 'editor' member (which is
      private and IPO should not be) does not clear itself when there are no entries
      to remove (e.g. is empty).

        At some point in JComboBox.removeAllItems(), there should be the command
      this.editor.setItem(null);
      so that the JTextField is cleared out, even though there are no entries to
      remove.
      (Review ID: 118643)
      ======================================================================

            mdavidsosunw Mark Davidson (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: