?
Solved

Making row headers look like column headers.

Posted on 2004-04-30
5
Medium Priority
?
178 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

743 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