@Override
        public void columnSelectionChanged(ListSelectionEvent e) {
            if (isAutoFitRowHeights() && e.getValueIsAdjusting()) {
                if (table.getColumnSelectionAllowed()
                        && !table.getRowSelectionAllowed()) {
                    fitAllRowHeights(table);
                } else {
                    int focusedRow = table.getSelectionModel().getLeadSelectionIndex();
                    if (focusedRow != -1) {
                        fitRowHeight(table, focusedRow);
                    }
                }
            }
        }