I set the checkbox to the jtable using default model, by using following code:
Object[] ColumnData = {"Sr No","Ward Name","Total voters","Action"};
Object[][] RawData=null;
//loop
model.insertRow(x, new Object[]{ key,ward_name_var,total_vot_var,new Object[]{o}});
model.setValueAt(o,x,3);
tblWard.setModel(model);
Setchk(tblWard,3,checkbox);// by calling this method which refers renderer
//set renderer each time when i fill the rows by using database
private void Setchk(JTable jTable1, int i, JCheckBox checkbox)
{
jTable1.getColumnModel().getColumn(i).setCellRenderer((new CWCheckBoxRenderer()));
jTable1.getColumnModel().getColumn(i).setCellEditor(new CheckBoxCellEditor());
}
But my database having large number of records, when I click on any checkbox it runs to check state of each and every checkbox contain in same column.
It can decrease performance of mine system so provide me solution for how I avoid situation so it will not go to check the state of all checkboxes.
Please suggest a book or link to understand the Renderer property of jtable.