@ SuppressWarnings ( "incomplete-switch" ) protected Icon getIcon ( JTable table , int column ) { SortKey sortKey = getSortKey ( table , column ) ; if ( sortKey != null && table . convertColumnIndexToView ( sortKey . getColumn ( ) ) == column ) { switch ( sortKey . getSortOrder ( ) ) { case ASCENDING : return UIManager . getIcon ( "Table.ascendingSortIcon" ) ; case DESCENDING : return UIManager . getIcon ( "Table.descendingSortIcon" ) ; } } return null ; }
Overloaded to return an icon suitable to the primary sorted column or null if the column is not the primary sort key .