I'm a little bit embarrassed to ask this - but what do I have to do to add a custom table cell renderer for a JTable to Netbeans GUI Builder? I'm trying to build a project from scratch but I haven't found a way to do this. I haven't found any related discussions on the internet either, so I'm really stuck right now. If I did this by hand, it would simply look like this:
myTable.setDefaultRenderer(Integer.class, new myRenderer());
Answering peeskillet's questions:
Basically, it's still about this example. I know the first two columns, let's say someone's name (String) and age (Integer). I also know that the rest of the columns will contain Boolean values.
Hence, my table model looks like this:
@Override
public Class<?> getColumnClass(int column) {
switch (column) {
case 0:
return String.class;
case 1:
return Integer.class;
default:
return Boolean.class;
}
}
It's not that this isn't working. I simply couldn't find out how to do the setDefaultRenderer part in Netbeans.