I want to implement a JTable
in my program which has mulitple type different rows.
Here is an example:
So basically costs
are calculated like that:
Sale * Production * Production % = Costs
What I am totally unsure is: How to give each row in the JTable model a new "type" of column. At the moment I am using the JTable model like that:
public Object getValueAt(int row, int col) {
Customer cd = customerList.get(row);
switch (col) {
case 0:
return cd.getName();
case 1:
return cd.getAge();
case 2:
return cd.getPhone();
default:
break;
}
return null;
}
Any recommendations how to implement this use case?
I appreciate your answer!