Swing - Setting the color of a cell based on the value of a cell
问题 I would like to set the color of a cell based on the value of the cell. Having googled around for a bit i found out that i can do it using something like this: public class TableCellRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) { // get the DefaultCellRenderer to give you the basic component Component c = super.getTableCellRendererComponent(table, value,