private void addColumn ( int index ) { TableColumnModel columnModel = getColumnModel ( ) ; TableColumn column = columnModel . getColumn ( index ) ; while ( tableColumns . size ( ) - 1 < index ) { tableColumns . add ( null ) ; } tableColumns . set ( index , column ) ; column . addPropertyChangeListener ( widthListener ) ; JComponent component = componentFactory . apply ( index ) ; while ( customComponents . size ( ) - 1 < index ) { customComponents . add ( null ) ; } customComponents . set ( index , component ) ; add ( component ) ; }
Add the column and the custom component at the given index