Setting color of column in JTable
Hi,
i had a problem before where i needed to set the colour of a column in JTable; however that problem has been resolved as i have done;
table.getColumnModel().getColumn(0).setCellRenderer(new customTableCellRenderer());
and the renderer class is:
publicclass customTableCellRendererextends DefaultTableCellRenderer
{
public customTableCellRenderer()
{
}
public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected,boolean hasFocus,int row,int column)
{
if(column==0)
{
setBackground(Color.YELLOW);
}
returnthis;
}
}
however, my problem now is that the column does become rendered yellow but the text for that column disappears.
Any help would be most appreciated.

