nie można ustawić szerokości kolumny na zero, tzn. nie uczynić kolumny niewidoczną

Próbuję utworzyć jedną kolumnęJTable, niewidoczny, ustawiając szerokość na zero, ale nie może się zdarzyć i pozostaje widoczny dla szerokości = 15. Oto kod -

<code>public void restoreColumnWithWidth(int column, int width) {
        try {
            TableColumn tableColumn = table.getColumnModel().getColumn(column);
            table.getTableHeader().setResizingColumn(tableColumn);
            tableColumn.setWidth(width);
            tableColumn.setMaxWidth(width);
            tableColumn.setMinWidth(width);
            tableColumn.setPreferredWidth(width);
        } catch (Exception ex) {
        }
    }
</code>

Co jest nie tak z kodem?

questionAnswers(2)

yourAnswerToTheQuestion