tags:

views:

57

answers:

2

Hello Community.

Is there any way to create multiple column headers in a JTable? I mean, normally there is only one row, but I need two of them with the same format (headerlike), and combine some cells of one of those headers.

I need something like this:

Header0 |          Header123          | Header4
Header0 | Header1 | Header2 | Header3 | Header4

Is there any way?

Thank you in advance

+1  A: 

you can extend BasicTableHeaderUI and write your own implementation of paint method, in which you can draw any type of header. after this change default header UI with following command table.getTableHeader().setUI(MyTableHeaderUI)

rachvela
+2  A: 

The Groupable Header example is some old code that might be able to help you.

camickr