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

JComboBox will throw IndexOutOfBoundsException when removeAllItems() is called..

    XMLWordPrintable

Details

    Description



      Name: krT82822 Date: 01/14/99


      When removeAllItems() is called on a JComboBox before it has anything added to it, it will throw an IndexOutOfBoundsException. I believe it should
      simply not do anything (like trying to remove() a component from a container when the container doesn't contain that parent).

      This happened to me in this case:
      I read an INI file and parse another file based on info in the ini file, popuplating the JCBox with data from the second file. The user can then later
      select a different file to pull data from. To save me code, I use the same method to populate the JCBox. Necesarrily, I call removeAllItems() in that
      method(). I've got to try/catch it because of the first time I run through method, JCBox has no data.
      (Review ID: 52642)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              tsantossunw Tom Santos (Inactive)
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: