Demos and Usage of javax.swing.DefaultListModel.clear()


   1: import javax.swing.JLabel;
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.event.ListSelectionListener;
   4:         ...
   5:     
   6:     list = new JList(new DefaultListModel());
   7:     list.addListSelectionListener(this);
   8:         ...
   9:     public void clear() {
  10:     DefaultListModel model = (DefaultListModel) list.getModel();
  11: 
  12:         ...
  13:     model.clear();

View Full Code Here
   1: 
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.ListModel;
   4:         ...
   5: public class DefaultAddRemoveListModel implements AddRemoveListModel {
   6:     private DefaultListModel listModel;
   7:     private boolean sorted = false;
   8:         ...
   9: 
  10:     public DefaultAddRemoveListModel(DefaultListModel listModel) {
  11:         this.listModel = listModel;
  12:         ...
  13:     private void setItemsWithoutSorting(Collection items) {
  14:         listModel.clear();

View Full Code Here
   1: import javax.swing.JLabel;
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.event.ListSelectionListener;
   4:         ...
   5:         
   6:         list = new JList(new DefaultListModel());
   7:         list.addListSelectionListener(this);
   8:         ...
   9:     public void clear() {
  10:         DefaultListModel model = (DefaultListModel) list.getModel();
  11:         
  12:         ...
  13:         model.clear();

View Full Code Here
   1: import javax.swing.JButton;
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.JLabel;
   4:         ...
   5:         JList lista = lista_modelo.getLista();
   6:         DefaultListModel dlm = (DefaultListModel)lista.getModel();
   7:         switch(accion) {
   8:         ...
   9:                     else
  10:                         dlm.clear();
  11:                     break;
  12:         ...
  13:                                 }
  14:                             dlm.clear();

View Full Code Here
   1:     private JList list = new JList();
   2:     private DefaultListModel listModel = new DefaultListModel();
   3:     private BorderLayout borderLayout1 = new BorderLayout();
   4:         ...
   5:     public void clearTasks() {
   6:         listModel.clear();
   7:         hasWarning = false;
   8:     }

View Full Code Here
   1: import javax.swing.JTextField;
   2: import javax.swing.DefaultListModel;
   3: 
   4:         ...
   5:     private ResourceMoverControl mover;
   6:     private DefaultListModel allInstancesListModel;
   7: 
   8:         ...
   9: 
  10:         allInstancesListModel = new DefaultListModel();
  11:         mover = new ResourceMoverControl(model,allInstancesListModel,ResourceMoverControl.MOVER_REGION);
  12:         ...
  13: 
  14:             allInstancesListModel.clear();

View Full Code Here
   1: 
   2:         DefaultListModel model = (DefaultListModel)props.getModel();
   3:         ...
   4:         model.clear();
   5:         Property[] items = sd.getProperties();
   6:         ...
   7:     {
   8:         DefaultListModel model = (DefaultListModel)list.getModel();
   9:         ...
  10:         model.clear();

View Full Code Here
   1:   private int              rows_;
   2:   private DefaultListModel model_;
   3:   private Vector           itemListeners_;
   4:         ...
   5:     rows_=_rows;
   6:     model_=new DefaultListModel();
   7:     itemListeners_  =new Vector(1,1);
   8:         ...
   9:   {
  10:     model_.clear();
  11:   }
  12:         ...
  13:   {
  14:     model_.clear();

View Full Code Here
   1: 
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.ListModel;
   4:         ...
   5: 
   6:     private DefaultListModel delegate = new DefaultListModel()
   7:     {
   8:         ...
   9:     {
  10:         delegate.clear();
  11:     }

View Full Code Here
   1: import javax.swing.BorderFactory;
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.JButton;
   4:         ...
   5: {
   6:     DefaultListModel exprListModel = new DefaultListModel();
   7:     JList exprList = new JList(exprListModel);
   8:         ...
   9:         if (!exp.trim().equals("")){
  10:             exprListModel.clear();
  11:             String[] sep = exp.split("\n");

View Full Code Here
   1:     JList completionList;
   2:     DefaultListModel completionListModel;
   3:     JScrollPane listScroller;
   4:         ...
   5:         completer = new Completer();
   6:         completionListModel = new DefaultListModel();
   7:         completionList = new JList(completionListModel);
   8:         ...
   9:         public void clearCompletions () {
  10:             completions.clear();
  11:             buildPopup();
  12:         ...
  13:         private void buildPopup() {
  14:             completionListModel.clear();

View Full Code Here
   1: 
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.JList;
   4:         ...
   5: 
   6:       DefaultListModel listModel = (DefaultListModel) listBox.getModel();
   7:         ...
   8:       listModel.clear();
   9: 
  10:         ...
  11:       for (int i = 0; i < ni.length; i++) {
  12:          ni[i].getOutGoingLinks().clear();

View Full Code Here
   1:     JList      list;
   2:     DefaultListModel model;
   3:     JScrollPane slist;
   4:         ...
   5: 
   6:         model = new DefaultListModel();
   7:         populateModel(extra);
   8:         ...
   9:     public void reloadModel( ) {
  10:         model.clear();
  11:         populateModel( extra );
  12:         ...
  13:                 Object o = theList.getModel();
  14:             DefaultListModel listModel = (DefaultListModel) theList.getModel();

View Full Code Here
   1: 
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.JList;
   4:         ...
   5:    private JScrollPane pane;
   6:    private DefaultListModel model;
   7:    private A auxilary;
   8:         ...
   9:    {
  10:       model = new DefaultListModel();
  11:       setModel(model);
  12:         ...
  13:       
  14:       model.clear();

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.DefaultListModel;
   3: import javax.swing.event.ListDataListener;
   4:         ...
   5: 
   6:     DefaultListModel model = new DefaultListModel();
   7: 
   8:         ...
   9:     
  10:     model.clear();
  11: 
  12:         ...
  13: 
  14:     model.clear();

View Full Code Here