Aqeel Haider
Aqeel Haider

Reputation: 633

Jtable1 header given to Jtable2 with properties like Sorting and Margin re-sizing

I Created two Jtable table1 and table2. I give table1 header to table2 by this code.

table2.setTableHeader(table1.getTableHeader());

but i also want to give properties of table1 header to table2. like Sorting and Margin re-sizing.

Upvotes: 0

Views: 51

Answers (2)

camickr
camickr

Reputation: 324118

like Sorting

Sorting is controlled by the RowSorter so I would guess you also need to share the sorter.

Read the secton from the Swing tutorial on Sorting and Filtering for more information.

I guess you would use getRowSorter(...) on table1 and setRowSorter(...) on table2.

Upvotes: 1

mKorbel
mKorbel

Reputation: 109813

but i also want to give properties of table1 header to table2. like Sorting and Margin re-sizing.

Upvotes: 1

Related Questions