JTable cell span merge

前端 未结 1 1336
暖寄归人
暖寄归人 2020-12-19 20:11

Hi I\'m having a problem with Java JTable. I want to merge or span cells. I did it using this examples:

http://www.java3z.com/cwbwebhome/article/article5/swing_exam

相关标签:
1条回答
  • 2020-12-19 20:30

    The same example is available here. It seems the problem might be in MultiSpanCellTable getCellRect() implementation. Column margin is contributing to the cell width and generating this offset. Looks like the problem goes away if you replace:

    cellFrame.width = aColumn.getWidth() + columnMargin;
    

    with:

    cellFrame.width = aColumn.getWidth();
    
    0 讨论(0)
提交回复
热议问题