我正在尝试创建一个包含JCombobox在扩展类中的行AbstractTableModel。
我有一个称为数据的二维数组。我也使用该方法getColumnCount()来实现两个按钮“上一个”和“下一个”。我已经标记了我认为JCombobox应该在哪里,但我不知道我应该如何在整行中实施。
public class SwitchTableModel extends AbstractTableModel{
    @Override
    public int getRowCount() {
        // Standard number of rows
        return 3;
    }
    @Override
    public int getColumnCount() {
        // Number of columns change according to the data
        return data [position].length + 1;
    }
    public Object getValueAt(int rowIndex, int columnIndex) {
        switch (rowIndex)
        {
        case 0:
            return columnIndex == 0 ? "ID" : idArray [data [position][columnIndex - 1]];
        case 1:
            return columnIndex == 0 ? "Company Name" : company_nameArray [data [position][columnIndex - 1]];
        case 2: 
            return columnIndex == 0 ? "Double" : ...???
        default:
            throw new Error ();
        }
    }
    public void previous ()
    {
        position -= 1;
        if (position < 0) position = data.length - 1;
        fireTableStructureChanged();
    }
    public void next ()
    {
        position += 1;
        if (position >= data.length) position = 0;
        fireTableStructureChanged();
    }
}
任何帮助都是有价值的