Solved

Making row headers look like column headers.

Posted on 2004-04-30
5
173 Views
Last Modified: 2010-03-31
I need to make the 1st column's cells look like the column headers.

Thanks.
0
Comment
Question by:Flavaflav
  • 2
5 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10965893
try using the same renderer for the column as is used for the headers.
0
 

Author Comment

by:Flavaflav
ID: 10965950
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
 

Author Comment

by:Flavaflav
ID: 11025764
Problem solved. I need to subclass JTable and get the renderer like this:

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

and return it in getTableCellRenderer().
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11069645
Closed, 150 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question