Making row headers look like column headers.

I need to make the 1st column's cells look like the column headers.

Thanks.
FlavaflavAsked:
Who is Participating?
 
moduloConnect With a Mentor Commented:
Closed, 150 points refunded.

modulo
Community Support Moderator
Experts Exchange
0
 
objectsCommented:
try using the same renderer for the column as is used for the headers.
0
 
FlavaflavAuthor Commented:
I tried the following, but it didn't work.

    private void rendererTest()
    {
        TableColumn column = tblDecisions.getColumnModel().getColumn(0);
        TableCellRenderer renderer = column.getHeaderRenderer();
        column.setCellRenderer(renderer);
    }

0
 
FlavaflavAuthor Commented:
Problem solved. I need to subclass JTable and get the renderer like this:

TableCellRenderer ren = tblDecisions.getTableHeader().getDefaultRenderer();

and return it in getTableCellRenderer().
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.