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

[1593 byte] By [smdattaa] at [2007-10-3 2:43:57]
# 1
Override the getCellEditor(...) method to return the appropriate editor. Something like this: http://forum.java.sun.com/thread.jspa?forumID=57&threadID=637581
camickra at 2007-7-14 20:32:21 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks,I decided to write my own cell editor derived from AbstractCellEditor
smdattaa at 2007-7-14 20:32:21 > top of Java-index,Desktop,Core GUI APIs...