Hung Pham Do
Hung Pham Do

Reputation: 21

Difference bewteen using TableRowSorter with getColumnClass and without getColumnClass

I sorted data a table in java. Both sort with getColumnClass and without getColumnClass is done. What's the difference between them? Thanks all

Upvotes: 0

Views: 88

Answers (1)

trashgod
trashgod

Reputation: 205785

The getColumnClass() method is required for all implementations of TableModel; a table without getColumnClass() is not possible. It "is used by the JTable to set up a default renderer and editor for the column," as may be required to refresh rows changed due to sorting. The number of times it is called is unspecified.

If you suspect that your implementation is a problem, you should profile the application.

Upvotes: 1

Related Questions