Solved

Making row headers look like column headers.

Posted on 2004-04-30
5
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

691 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