posted 21 years ago
Yes, it is possible. I did this in a project.
You have to do this in your own TableCellRenderer.
There you have to implement the function getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column).
The value is exactly the value, which is returned by your TableModel. So you can cast it to your own Object, let's say it is called ColorValue.
Then you ask your ColorValue for the color.
If your TableCellRenderer extends from DefaultTableCellRenderer then it also inherits the methods of JLabel, so you can set foreground and background colors.
Bye
Rene