I have created a custom TableModel using AbstractTableModel. I am able to populate my JTable. But my JTable has a button column say "Button1". So I am using CellRenderer method to add buttons to column and CellEditor to add actions, but I am getting exception at LINE:3.
CustomModelForTable customTableModel = new CustomModelForTable(colNames, data);
tableA = new JTable(customTableModel);
**LINE:3**
tableA.getColumn("Button1").setCellRenderer(new JButtonRendererClass());
tableA.getColumn("Button1").setCellEditor(new ButtonEditor(new JCheckBox()));
I am getting the following error.
java.lang.IllegalArgumentException: Identifier not found
at javax.swing.table.DefaultTableColumnModel.getColumnIndex(DefaultTableColumnModel.java:265)
I am getting this error because I am not able to get the Column from my custom Table. But can some one help me out with this issue.
I am using the following source to perform this task. In this source they are using DefaultTableModel where as in my case I am using AbstractTableModel
.