I set the renderer to the checkbox on jtable using following code
Object[] ColumnData = {"Sr No","Ward Name","Total voters","Action"}; Object[][] RawData=null;
// in 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 contains following
private void Setchk(JTable jTable1, int i, JCheckBox checkbox) { jTable1.getColumnModel().getColumn(i).setCellRenderer((new CWCheckBoxRenderer())); jTable1.getColumnModel().getColumn(i).setCellEditor(new CheckBoxCellEditor()); }
Blockquote
how can we try it for row to set the checkbox on jtable. thanks in advance.