setting JcomboBox editor for a table cell
Hi,
I have a ComboBox editor for a cell in my table. I want to set this editor depending on the value of another column
qualifierTable.addMouseListener(new MouseAdapter(){
publicvoid mouseClicked(MouseEvent e){
int selRow = qualifierTable.getSelectedRow();
int selCol = qualifierTable.getSelectedColumn();
if (someCondition)
{
JComboBox comboBoxEditor =new JComboBox();
comboBoxEditor.addItem("Private");
comboBoxEditor.addItem("Protected");
comboBoxEditor.addItem("Public");
qualDataValueCol.setCellEditor(new DefaultCellEditor(comboBoxEditor));
Object dataValue = comboBoxEditor.getSelectedItem();
if (dataValue!=null)
{qualifierTablemodel.setValueAt(dataValue, selRow, selCol);
}
}
The problem is this sets the editor for all cells in the column. However I want the editor to revert to JTextField if this condition is not met.Where should I set it back. It does not work if I set it in the else part

