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

RFE: Performance of JComboBox with DefaultComboBoxModel (re-open 4138101?)

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P4
    • None
    • 1.2.0, 1.3.0
    • client-libs
    • generic, x86
    • generic, windows_95

    Description



      Name: yyT116575 Date: 10/25/2000


      orig synopsis: "Horrible performance of JComboBox with DefaultComboBoxModel"
      see also # 4173836

      java version "1.2.2"
      Solaris VM (build Solaris_JDK_1.2.2_05a, native threads, sunwjit)


      I'm sorry to resubmit a bug which is already in your database, but
      I seriously think you should look at this one again. It would take a
      sun developer all of five minutes to fix, and it would improve performance
      of JComboBox by SECONDS not just milliseconds.

      Considering the bang for the buck, I simply can't believe this has gone
      so long without being fixed.

      Please reexamine bug 4138101. The problem is that with a
      DefaultComboBoxModel, there's no way to add a large group of items to
      the model. If you add them one at a time, with addElement(Object val),
      then fireIntervalAdded() is called for each and every element you add,
      which is VERY VERY slow.

      I had a frame that contained a table. Two of the columns in the table
      had cell editors that were JComboBoxes, each with about 100 items in them.
      Initially, I added the items to the JComboBoxes one at a time. It took
      my frame a whopping 15 - 17 seconds to come up!!!! Almost unbelievable.
      Then I simply changed the constructors of the JComboBoxes to take a vector
      of the values, and the frame came up in about 3 seconds.

      The problem I face is in a different part of the code where I MUST change the
      list of values in the combo box after the combo box is constructed. I
      simply can't do it in a quick way.

      PLEASE FIX THIS! It's SOOOO easy to fix on your end and will improve
      performance for lots and lots of your users.
      (Review ID: 110650)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              mdavidsosunw Mark Davidson (Inactive)
              yyoungsunw Yung-ching Young (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: