List of utility methods to do JTable Color
Color | getTableBackgroundColor(boolean colored) get Table Background Color if (colored) return new Color(0xf4f4f4); return UIManager.getColor("Table.background"); |
Color | getTableGridColor() get Table Grid Color return UIManager.getColor("Table.gridColor"); |
void | possiblyFixGridColor(JTable table) Make a table use the right grid color on Windows Vista, when using the Windows Look and Feel. String laf = UIManager.getLookAndFeel().getClass().getName(); if (laf.endsWith("WindowsLookAndFeel")) { if (Color.white.equals(table.getBackground())) { Color gridColor = table.getGridColor(); if (gridColor != null && gridColor.getRGB() <= 0x808080) { table.setGridColor(new Color(0xe3e3e3)); |
Component | setBackgroundColor(final Component comp, final JTable table, boolean isSelected) Set the background colour from the table. return setBackgroundColor(comp, table, isSelected, null);
|
Component | setColors(final Component comp, final JTable table, boolean isSelected, Color bgColor, Color fgColor) set Colors setBackgroundColor(comp, table, isSelected, bgColor);
setForegroundColor(comp, table, isSelected, fgColor);
return comp;
|
Component | setForegroundColor(final Component comp, final JTable table, boolean isSelected, Color fgColor) set Foreground Color if (isSelected) { comp.setForeground(table.getSelectionForeground()); } else { comp.setForeground(fgColor == null ? table.getForeground() : fgColor); return comp; |