• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable Format Question

 
Michael Cocchi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Morning,

I have a JTable with 14 number/string columns.
Every other row or thereabouts I want to simply display a sentence that may take up the length of an entire row.

so basically I want the text in the first cell in a row to be able to span the length the whole row if necessary. (like in excel)

Is this possible?

Thanks
 
Michael Cocchi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After wasting a whole day researching, I have found that my only hope may lie in creating a custom TableCellRenderer. I have done so but have not found a way to lengthen the cell width. I can do all kinds of fun stuff to the cells but not length the width.

Please remember that I want custom column widths by row.

Any help?
 
raoul schmidiger
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i got the same problem. there doesn't seem to be an easy answer to this. one guy once managed, but he tweaked the standard lib quite a bit.

i am now going to do it like this: i take a table with one column. when i want to put a row in, that spans all columns, i add a label, when there should be more than one cell, i add another table in the cell of the outer table.

should be easy.

regards raoul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic