public void reset ( ) { table . getColumnModel ( ) . removeColumnModelListener ( this ) ; columnModel = table . getColumnModel ( ) ; columnModel . addColumnModelListener ( this ) ; // Keep a duplicate TableColumns for managing hidden TableColumns int count = columnModel . getColumnCount ( ) ; allColumns = new ArrayList <> ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { allColumns . add ( columnModel . getColumn ( i ) ) ; } }
Reset the TableColumnManager to only manage the TableColumns that are currently visible in the table .