list
Object [] a = { "a", "bb", "ccc" }; MyModel m = new MyModel (a); jList1.setModel (m);
package pokus; import javax.swing.*; public class MyModel extends AbstractListModel { private Object [] data; public MyModel (Object [] p) { data = p; } public int getSize () { return data.length; } public Object getElementAt (int index) { return data [index]; } }
list.txt · Last modified: 2014/10/23 16:18 by 127.0.0.1