使用Java JTable从中间单元中删除水平边框

时间:2014-10-02 02:25:15

标签: java jtable border

如何删除jtable的中间边框。

从此......

enter image description here

To This ..

enter image description here

这是我的代码

    Object rowData[][] = { { "", "", "", "", "", "", "" },  //4 empty row
                           { "", "", "", "", "", "", "" }, 
                           { "", "", "", "", "", "", "" },
                           { "", "", "", "", "", "", "" } 
                         };

    Object columnNames[] = { "File Type", "Total File", "Size(GB)", "  ",
            "File Type", "Total File", "Size(GB)" };

    JTable table = new JTable(rowData, columnNames);

    JScrollPane scrollPane = new JScrollPane(table);

1 个答案:

答案 0 :(得分:1)

更轻松的一种方法是绘制2个表格,它们之间有间距。

请注意,如果要排序和删除,将会有一些工作要保持2个表同步。

相关问题