Putting JComboBox into JTable

前端 未结 9 1303
离开以前
离开以前 2020-11-30 10:22

I want to put individual JComboBoxes into each cells of a JTable. ie. The JComboBox content is not identical for each cell.

I basically would like to be able to jus

9条回答
  •  广开言路
    2020-11-30 10:57

    You need to create a subclass of JTable to override the method TableCellEditor getCellEditor(int row, int column).

    This enables you to set arbitrary cell editors for any row and column combination. The default way is to set the cell editor for an entire column.

    (You can also set individual cell renderers by overriding getCellRenderer.)

提交回复
热议问题