I'm new to Swing and have been struggling with the JTable component today. Because I'm trying to make a somewhat-fancy table I haven't been able to find the particular answers I'm looking for anywhere yet.
I would like to have a "group" of headers at the very top of the table. This means 3 or 4 rows that span the whole table, and "group" the various columns, essentially partitioning them.
Example (pardon the eye strain):
////////////////////////////////ANIMALS//////////////////////////
/////////Mammals///////////////////////Rodents///////////////////
////People/////Dogs//////////Rats/////Rodents of Unusual Size////
Where slashes ("/") denote whitespace. The first header, titled "ANIMALS" refers to all the columns in the table. The second header down partitions ANIMALS, so on and so forth. After the third and final header we arrive the actual table, where each row will have 4 columns, one for each type of Animal.
Obviously this is an example, and probably a bad one, but this is what I mean by "partitioning headers".
My question: I don't see how JTableHeader and TableColumnModel support this functionality. If they do, can someone nudge me in the right direction. If they don't, this surely can't be the first time a Swing app has needed something like this. Any 3rd party components anyone knows of?
Also, I'd like to be able to have "Spacer" or Spanning Rows sprinkled throughout my table, representing a group of rows. These Spacers would exist inside the table (not on top of it like a header), but would span every column and have a single label, representing the name of the group represented by the subsequent rows. Again, I don't see Swing supporting this, any ideas?
Thanks and I do apologize for the truly-awful example/drawing.