At 01:13 PM 12/13/2001 -0800, michael hollander wrote: >We would like to render a whole row in a JTable from >one component rather than in cells. For example, we'd >like the table to look like this: > > > ------------------------------------- > | 0 | 0 | 0 | 0 | 0 | 0 | 5 |35 | 6 | > ------------------------------------- > | A | H | ^%| 2 | # | % | ^ | # | $#| > ------------------------------------- > | This row is not made up of cells | > ------------------------------------- > | | | | | | | | | | > ------------------------------------- > > >Any hints?
Yow. I don't think you can do this with JTable. JTable has built-in support for things like column rearranging and resizing, which doesn't make as much sense with a spanning row in the middle. You could actually allllmost do this with a special table cell renderer that returns a table-wide component for this one row, but I don't think you can tell it to not clip that cell, so it wouldn't quite work. Another funky thing you could do is make a cell renderer that draws a picture of that row, and then returns the appropriate slice of that picture for each column. Both of these solutions seem like overkill to me, though. The problem is that JTable simply doesn't support cells which span more than one position, AFAIK. One more possible solution is to make this into a one-column table, or even a list, and draw every row yourself. But then you lose the ability to manipulate individual columns, and you also have to carefully make sure you draw all the columns as being the same width. Finally, you could simply replace the JTable with a JEditorPane, and stick in HTML table tags as appropriate. That might be the easiest solution. Otherwise, I don't see any way to do this without writing an entirely new component. _______________________________________________ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing
