Die Spaltenbreite konnte nicht auf Null gesetzt werden, d. h. die Spalte wurde nicht unsichtbar gemacht
Ich versuche eine Spalte daraus zu machenJTable
, unsichtbar durch Setzen von width auf Null, aber es konnte nicht passieren und es bleibt für width = 15 sichtbar. Hier ist code -
<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>
Was ist los mit dem Code?