code: public void setModel(ListModel model) {
          helperList.setModel(model);
  
          dataModel = model;
          clearSelection();
  
          // Once we have a model, we can properly size the two display lists
          // They should be wide enough to hold the widest string in the model.
          // So take the width of the source list since it currently has all the
          // data.
          Dimension d = helperScroller.getPreferredSize();
          chosenPanel.setPreferredSize(d);
          sourcePanel.setPreferredSize(d);
      }
docs: Sets the model that represents the contents or "value" of the list and
  clears the list selection.
  
  @param model the <code>ListModel</code> that provides the list of items
  for display
  @exception IllegalArgumentException if <code>model</code> is
  <code>null</code>