J
John M
Hello,
I have a problem with a cell renderer. I want to make a column with
checkboxes, and I write the following code. When I edit the cell it use a
checkbox editor, but if I leave the cell it returns to a text (true/false).
What can I do?
model.addColumn("Col1");
model.insertRow(0,new Boolean[]{new Boolean(false)});
jTable1.getColumnModel().getColumn(0).setCellEditor(new
DefaultCellEditor(new JCheckBox()));
jTable1.getColumnModel().getColumn(0).setCellRenderer(new
DefaultTableCellRenderer());
Thanks!
I have a problem with a cell renderer. I want to make a column with
checkboxes, and I write the following code. When I edit the cell it use a
checkbox editor, but if I leave the cell it returns to a text (true/false).
What can I do?
model.addColumn("Col1");
model.insertRow(0,new Boolean[]{new Boolean(false)});
jTable1.getColumnModel().getColumn(0).setCellEditor(new
DefaultCellEditor(new JCheckBox()));
jTable1.getColumnModel().getColumn(0).setCellRenderer(new
DefaultTableCellRenderer());
Thanks!