1

I have a JTable where two columns are Boolean and I use this method to recognize the type of data:

public Class getColumnClass(int column){
    if ((getValueAt(0, column)) == null){
        return super.getColumnClass(column);

    }

The data is shown perfectly like a CheckBox, but the background is white, unlike the rest of the columns:

White background

Just let me know if you need some more code. **I'm using the NimbusLookAndFeels (don't know if it really matters)

Thanks in advance

EDIT: I found already an answer for my question in this post:

JTable - Boolean Cell Type - Background

I don't know how I can set it like duplicate question

Community
  • 1
  • 1
Mario J.G.
  • 74
  • 12

0 Answers0