1 14 package org.wings; 15 16 import javax.swing.*; 17 import java.util.ArrayList ; 18 import java.util.List ; 19 20 24 public class SDefaultListModel 25 extends AbstractListModel { 26 protected final ArrayList data = new ArrayList (2); 27 28 29 public SDefaultListModel(List d) { 30 data.clear(); 31 if (d != null) { 32 for (int i = 0; i < d.size(); i++) 33 data.add(d.get(i)); 34 } 35 } 36 37 38 public SDefaultListModel(Object [] d) { 39 data.clear(); 40 if (d != null) { 41 for (int i = 0; i < d.length; i++) 42 data.add(d[i]); 43 } 44 } 45 46 47 public SDefaultListModel() { 48 } 49 50 51 public int getSize() { 52 return data.size(); 53 } 54 55 56 public Object getElementAt(int i) { 57 return data.get(i); 58 } 59 60 } 61 62 63 | Popular Tags |