Reputation: 473
I've a problem that is driving me crazy.
I have a classic JTable, with several columns. I need that a particular column, instead of simple texts values in its cell, it must contain a ComboBox. I searched A LOT, all I found was examples that would implement the same JComboBox in each cell of the column, that it's not what I need: I need that each cell of the column has a combo box with different values.
Can anyone give me some practical example of how to do it, please?
Thanks.
PS: I'm using NetBeans.
Upvotes: 0
Views: 954
Reputation: 691685
The TableCellEditor.getTableCellEditorComponent()
method takes a row as argument. Use the existing example as a guide, and use the row argument of this method to decide which values must be proposed by the combo box.
Upvotes: 2