public void setSortedByColumn ( JTableHeader tableHeader , int iViewColumn , boolean bOrder ) { if ( ! ( tableHeader . getDefaultRenderer ( ) instanceof SortableHeaderRenderer ) ) tableHeader . setDefaultRenderer ( new SortableHeaderRenderer ( tableHeader . getDefaultRenderer ( ) ) ) ; // Set up header renderer the first time ( ( SortableHeaderRenderer ) tableHeader . getDefaultRenderer ( ) ) . setSortedByColumn ( tableHeader , iViewColumn , bOrder ) ; }
Change the tableheader to display this sort column and order .