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

Setting elements in a DefaultListModel fires multiple events

XMLWordPrintable



      Name: rk38400 Date: 11/10/98


      In Swing 1.1 Beta3
      The DefaultListModel class is missing API to set or append the internal elements of the model with an array of elements.
      In the current implementation, one is forced to set each element one by one using add(), set() or similar methods.
      Each of these call results in a content changed or interval added event.
      For large models, this could cause unneeded hit in performance as well as superfluous redraws.

      I presume that this problem is also common to other default model implementations but I didn't
      check (DefaultTreeModel, DefaultTableModel, ...).

      Also, it would have been easy to implement the missing API ourselve by subclassing if the vector containing the elements (delegate)
      had been made protected. Unfortunately, it is private...
      (Review ID: 42400)
      ======================================================================

            stewilso Steve Wilson (Inactive)
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: