Hi,
> I have created a custom tablecellrenderer of type jlabel. Before that
> I left it to the default.
>
> However now that I have a custom tablecellrenderer, the cell no longer
> gets highlighted when the user selects the row!
have a look at
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/table/TableCellRenderer.html.
The method that is responsible for creating and returning the component
used for rendering accepts a boolean parameter that tells you whether
the cell is selected or not. It is your job to use that information, in
other words, you have to differentiate between "selected" and
"unselected" cells in your code and define appropriate rendering. E. g.
when you use a JLabel for rendering, you could have something like:
JLabel rendererComponent = new JLabel();
if (isSelected) rendererComponent.setBackground(Color.RED);
to mark selected Cells with red.
If you don´t check the selection state of the cell, than I think you
won´t get any highlighting.
HTH,Piet