I have a table, in which I am adding new rows. After 6 rows with data I want to add an empty row with the background color red then, another 6 rows with white background and so on.
private void populate(){
DefaultTableModel model = (DefaultTableModel) table.getModel();
int i,j;
for(j=0;j<6;j++){
for(i=0;i<6;i++){
model.addRow(new Object[]{"dada","dadaddd"});
}
model.addRow(new Object[]{"",""}); //<-this is the red row i want to add
}
}
How can I change the color of the empty row?
Found the answer , like mre told me