Welcome to Dream.In.Code
Become a Java Expert!

Join 149,500 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,376 people online right now. Registration is fast and FREE... Join Now!




jtable column header spanning

 
Reply to this topicStart new topic

jtable column header spanning, I want the header to cover 4 columns

alpha02
25 Mar, 2007 - 06:45 PM
Post #1

D.I.C Addict
Group Icon

Joined: 20 May, 2006
Posts: 687


Dream Kudos: 850
My Contributions
Hi again! I have a JTable and I want the column headers to cover 4 columns. How can this be achieved? I do not need a big code to allow row/column spanning, just an example of how to span a column header would be appreciated. thanks in advance smile.gif

p.s. I googled for two hours and I did not find anything.

This post has been edited by alpha02: 25 Mar, 2007 - 06:45 PM
User is offlineProfile CardPM
+Quote Post

gyron
RE: Jtable Column Header Spanning
27 Mar, 2007 - 02:32 AM
Post #2

D.I.C Head
**

Joined: 9 Jan, 2007
Posts: 61


My Contributions
hie
i think you might have to use two tables instead, one with only the columnHeaders showing(for the big headers spanning 4 columns) and one with columnHeaders hidden(with the former table's columnHeaders now 'acting' as the later's headers). You would also have to use BorderLayout so that the columnHeaders are placed using BorderLayout.NORTH.

I hope this points you to some workable solution.

User is offlineProfile CardPM
+Quote Post

alpha02
RE: Jtable Column Header Spanning
27 Mar, 2007 - 02:45 PM
Post #3

D.I.C Addict
Group Icon

Joined: 20 May, 2006
Posts: 687


Dream Kudos: 850
My Contributions
QUOTE(gyron @ 27 Mar, 2007 - 06:32 AM) *

hie
i think you might have to use two tables instead, one with only the columnHeaders showing(for the big headers spanning 4 columns) and one with columnHeaders hidden(with the former table's columnHeaders now 'acting' as the later's headers). You would also have to use BorderLayout so that the columnHeaders are placed using BorderLayout.NORTH.

I hope this points you to some workable solution.


That's what I did, and it works. Thanks for the tip!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 06:26PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month