Your overridden getColumnClass
is lying: the second column is not of type TablePercentValue
, it's still a String
. For the purposes of your example, this can be fixed where you populate the data:
for(int j=0; j<tableData[0].length; j++){
if(j==2)
tableData[i][j] = new TablePercentValue(i+","+j+"%");
else if(j == 1)
tableData[i][j] = i+":"+j;
else
tableData[i][j] = i+""+j;
tableData[i][j] = value;
}
Inside the TablePercentValue
constructor I had to add an extra replace(",", ".")
compValue = Double.parseDouble(value.replace("%", "").replace(",", "."));
but this might just be a localization thing and run fine for you.