代码之家  ›  专栏  ›  技术社区  ›  brian_d

JTable,每行的列数不同

  •  4
  • brian_d  · 技术社区  · 15 年前


    如何让JTable只使用一列来布局某些行,如:

    A1 Section Title Row With long Text
    A2          B2          C2          D2
    A3          B3          C3          D3
    A4          B4          C4          D4
    A5 Section Title Row With long Text
    A6          B6          C6          D6
    A7 Section Title Row With long Text
    A8          B8          C8          D8
    A9          B9          C9          D9
    

    而不是

    A1 Section Title Row With long Text  B1          C1          D1
    A2                                   B2          C2          D2
    A3                                   B3          C3          D3
    A4                                   B4          C4          D4
    A5 Section Title Row With long Text  B5          C5          D5
    A6                                   B6          C6          D6
    A7 Section Title Row With long Text  B7          C7          D7
    A8                                   B8          C8          D8
    A9                                   B9          C9          D9
    

    谢谢。

    2 回复  |  直到 15 年前
        1
  •  3
  •   trashgod    13 年前

    看一看 this example

        2
  •  1
  •   Geoffrey Zheng    15 年前

    广告 JIDE Grids CellSpanTable GroupTable . 其基本思想与@dogbane的答案中的古老代码相同,即使用一个自定义的UI,它不会为跨单元格绘制网格线。