Ridzuan Adris
Ridzuan Adris

Reputation: 1272

Remove Horizontal Border From Middle Cell With Java JTable

How can i remove the middle border of jtable.

From this ..

enter image description here

To This ..

enter image description here

here is my code

    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);

Upvotes: 2

Views: 95

Answers (1)

StackFlowed
StackFlowed

Reputation: 6816

one way t do the smilier thing is to draw 2 tables with spacing between them.

Note there will be a some of work to keep 2 tables in sync as one in case of sorting and deleting.

Upvotes: 1

Related Questions