I cant find the answer to this anywhere - i am sure it is really simple but im quite confused!
i want to change the colour of the cell background when the value changes. I have written a cell renderer below:
public class CyanTableCellRenderer extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
cell.setBackground( Color.CYAN );
return cell;
}
}
I want to pass the value of the cell from the event in the listener - to highlight the cell.
Can anyone help?