0

I have a Jtable and intend to add JCheckboxes to it. There is quite a clear example here which I implemented yet kept on getting "true" and "false" String values when running. I then tried to run the example itself and discovered that it too is displaying "true"/"false" string values.

enter image description here

Is this a problem with my JRE? How can I be able to view/work with checkboxes?

Thanks.

greatkalu
  • 433
  • 1
  • 8
  • 21

1 Answers1

0

Did you make sure to override this function in your table model? This is what tells the table that those values are Booleans.

 @Override
 public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
 }
BenCole
  • 2,092
  • 3
  • 17
  • 26