Define your own cell renderer class which sets background colour for the cell like this
public class MyCellRenderer extends javax.swing.table.DefaultTableCellRenderer {
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column) {
java.awt.Component cellComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
cellComponent.setBackground(java.awt.Color.YELLOW);
return cellComponent;
}
}
and attach it to your table
MyCellRenderer mcr = new MyCellRenderer();
for (int columnIndex = 0; columnIndex < myTable.getColumnCount(); columnIndex ++) {
myTable.getColumnModel().getColumn(columnIndex).setCellRenderer(mcr);
}