tags:

views:

49

answers:

3

Hi, I want to create a JTable with a header inside some cells. But I want to associate a text with this header. Is it possible? How to do?

All my best! Leandro Lima

A: 

If I understand the question then you can create a panel using a BorderLayout. You add the table to the CENTER and the table header to the NORTH.

camickr
Something like that. But the idea is to create a row header I'll put a header in each cell from the first column. I can do it ok, but I don't know how to set the header text.
Leandro
A: 

table.getColumnModel().getColumn(x).setHeaderValue( "text" );

Nate
Hi Nate, thanks for this solution, but I don't have a table with columns, just the JTableHeader.
Leandro
A: 

I only way to do it I found was to create a table, without cells and with a column with a header title. So I get this header and put it inside other table by cell renderer.

Leandro