code: public void contentsChanged (ListDataEvent e)
      {
          // if this update is informing us of a new selection, reflect that
          // in the UI
          int start = e.getIndex0(), count = start - e.getIndex1() + 1;
          if (start == -1) {
              // figure out the selected index
              int selidx = -1;
              Object eitem = _model.getSelectedItem();
              if (eitem != null) {
                  int ecount = _model.getSize();
                  for (int i = 0; i < ecount; i++) {
                      if (eitem == _model.getElementAt(i)) {
                          selidx = i;
                          break;
                      }
                  }
              }
  
              // and update it
              updateSelection(selidx);
  
          } else {
              // replace the buttons in this range
              removeButtons(start, count);
              addButtons(start, count);
          }
     }
docs: documentation inherited from interface