-
FEATURED COMPONENTS
First time here? Check out the FAQ!
combobox.setModel(new SimpleListModel(Array)).
If Array > 10 then the combobox just show 10 data.
Can everyone help me?
best regards
you have confuse n4rk0 with your Array.
Not tested:
Try this as data:
List<String> myList = new ArrayList<String>(); myList.add("1"); myList.add("2"); myList.add("3"); myList.add("4"); myList.add("5"); myList.add("6"); myList.add("7"); myList.add("8"); myList.add("9"); myList.add("10"); myList.add("11"); myList.add("12"); myList.add("13"); myList.add("14"); myList.add("15"); myList.add("16"); myList.add("17"); myList.add("18"); myList.add("19"); myList.add("20"); myList.add("21"); myList.add("22"); myList.add("23"); myList.add("24");
call it like n4rk0 have written:
combobox.setModel(new myListModel(myList), 16 );
best
Stephan
Hallo Stephan,
i am to despair! The result is the same. The content of my combobox is
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
best andi
Where is the code of your renderer?
This is not correct. ZK ask for jth element and you return it the whole array.
public Object getElementAt(int j) { return _data; }
Should be
public Object getElementAt(int j) { return _data[ j ]; }
Asked: 2010-02-02 09:19:52 +0800
Seen: 1,178 times
Last updated: Feb 11 '10