A JTable where number of columns in each row may b

2019-07-13 02:53发布

I am looking for a solution for a JTable where I can vary the number of columns in each row, but where the size (in pixels) of the row is constant.

I found stackoverflow referencing so far only dead-links to an old solution:

JTable with varying number of columns per row

Is there a newer better way to do it now ? If so, what? If not, does anyone know what the old solution was?

thanks.

2条回答
Juvenile、少年°
2楼-- · 2019-07-13 03:41

I would create a renderer (panel with multiple fixed size labels or even multiple panels for each type of row).

It should be one column in TableModel with the renderer applied.

查看更多
\"骚年 ilove
3楼-- · 2019-07-13 03:45

Does anyone know what the old solution was?

The examples, which appear to have been created for a Swing beta release in the last millennium, may be found here. You may be looking for MultiSpanCellTable. They may be a useful object of study, but they are not current. YMMV.

查看更多
登录 后发表回答