TableColumn tableColumn = _table.getColumnModel().getColumn(0);
tableColumn.setCellEditor(new DefaultCellEditor(_combo));
// Set the second column to use a DynamicEditor
TableColumn secondCol = _table.getColumnModel().getColumn(1);
final DynamicTableCellEditor cellEditor = new DynamicTableCellEditor();
secondCol.setCellEditor(cellEditor);
// Listen for property changes to update the cell editor with
// registered types for editing.
_table.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
String selection = (String)_table.getModel().getValueAt(
_table.getSelectedRow(), 0);
if(selection != null && !selection.equals("")) {
Class type = null;
try {
type = _attributes.getType(selection);
cellEditor.register(selection, type);
} catch (ClassNotFoundException exp) {
exp.printStackTrace();
}
}
}