public static void setCellRenderer(JTable CustDtlsTbl) {
TableCellRenderer cellRenderer = createCellRenderer();
CustDtlsTbl.setDefaultRenderer(Object.class, cellRenderer);
}
...
public static TableCellRenderer createCellRenderer() {
return new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable CustDtlsTbl, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component cell = super.getTableCellRendererComponent(CustDtlsTbl, value, isSelected, hasFocus, row, column);
当值为负时,如何修改上述两种方法来改变单元格颜色?