Search code examples
javaswingjtablecellhtml

Merging cells in JTable


Is it possible to merge some cells of a JTable object?

merging cells
(source: codeguru.com)

If it's not possible through JTable what is the best approach. Thanks.


Solution

  • Not out-of-the-box. Here is an example that supports merging arbitrarty cells. This page has several examples of tables with spanning cells. Of course it's old and you get what you pay for. If paid software is an option, JIDE Grids has some really nice Swing table support including custom cell spans.