Skip to content

Instantly share code, notes, and snippets.

@HenryLoenwind
Created December 19, 2020 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HenryLoenwind/3d4601c0aa201a3a4f506fac64c8c5b6 to your computer and use it in GitHub Desktop.
Save HenryLoenwind/3d4601c0aa201a3a4f506fac64c8c5b6 to your computer and use it in GitHub Desktop.
private int growingColumn = -1;
public void setGrowingColumn(int growingColumn) {
this.growingColumn = growingColumn;
}
public void adjustColumns() {
TableColumnModel tcm = table.getColumnModel();
for (int i = 0; i < tcm.getColumnCount(); i++) {
if (i != growingColumn) {
table.getColumnModel().getColumn(i).setMaxWidth(99999);
table.getColumnModel().getColumn(i).setPreferredWidth(900);
adjustColumn(i);
}
}
}
private void updateTableColumn(int column, int width) {
...
// table.getTableHeader().setResizingColumn(tableColumn);
// tableColumn.setWidth(width);
tableColumn.setMaxWidth(width);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment