如何在jList中使用ComboBox

时间:2014-04-25 07:23:13

标签: java swing combobox jlist

我想使用组合框作为jList的元素。我在下面的代码中写了这个但是没有用。

AbstractListModel listmodel = new AbstractListModel() {
    Object [] objects = all_objects; //all_objects contains ComboBox and Strings
        public int getSize() {
            return objects.length;
        }

        public Object getElementAt(int index) {
            return objects[index];
        }
    };
jList2.setModel(listmodel);`

0 个答案:

没有答案