public void setModel(ListModel model) { ListDataListener l = new ListDataListener() { public void intervalAdded(ListDataEvent e) { repaint(); } public void intervalRemoved(ListDataEvent e) { repaint(); } public void contentsChanged(ListDataEvent e) { repaint(); } };  this.model = model; model.addListDataListener(l); }
public void setModel(ListModel m) { ListModel old = model; if (old != null) old.removeListDataListener(listListener); model = m; if (model != null) model.addListDataListener(listListener); firePropertyChange(MODEL_PROPERTY_CHANGED, old, m); }
    public void setModel(ListModel model)    {	ListDataListener l = new ListDataListener()	    {		public void intervalAdded(ListDataEvent e) {		    repaint();		}		public void intervalRemoved(ListDataEvent e) {		    repaint();		}		public void contentsChanged(ListDataEvent e) {		    repaint();		}	    };		this.model = model;  	model.addListDataListener(l);	    }