Solved

Making row headers look like column headers.

Posted on 2004-04-30
5
170 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now