private void showColumn ( TableColumn column ) { // Ignore changes to the TableColumnModel made by the TableColumnManager columnModel . removeColumnModelListener ( this ) ; // Add the column to the end of the table columnModel . addColumn ( column ) ; // Move the column to its position before it was hidden. // (Multiple columns may be hidden so we need to find the first // visible column before this column so the column can be moved // to the appropriate position) int position = allColumns . indexOf ( column ) ; int from = columnModel . getColumnCount ( ) - 1 ; int to = 0 ; for ( int i = position - 1 ; i > - 1 ; i -- ) { try { TableColumn visibleColumn = allColumns . get ( i ) ; to = columnModel . getColumnIndex ( visibleColumn . getHeaderValue ( ) ) + 1 ; break ; } catch ( IllegalArgumentException e ) { } } columnModel . moveColumn ( from , to ) ; columnModel . addColumnModelListener ( this ) ; }
Show a hidden column in the table . The column will be positioned at its proper place in the view of the table .