Rash1100
Rash1100

Reputation: 21

Adding JcomboBox in JTable

I have created a form in which I have added a jTable which has 3 columns. 2nd and 3rd column have jcombobox editor.

I want that when we select the first item of the 2nd column combobox first combobox of the 3rd column combobox should also be selected and vice-versa.

How can I do that?

Upvotes: 0

Views: 279

Answers (1)

StanislavL
StanislavL

Reputation: 57381

You can try to override public void setValueAt(Object aValue, int rowIndex, int columnIndex) method and check when value is set to the edited column you should also call setValueAt() for the first column.

Upvotes: 2

Related Questions