sbool tableSetColumnWidths_debug; static void tableSetColumnWidths(JTable table, Map widths) { pcall { TableColumnModel tcm = table.getColumnModel(); int n = tcm.getColumnCount(); for i to n: { TableColumn tc = tcm.getColumn(i); Int w = widths.get(str(tc.getHeaderValue()); if (w != null) { tc.setPreferredWidth(w); if (tableSetColumnWidths_debug) print("Setting width of column " + i + " to " + w); } } } } static void tableSetColumnWidths(JTable table, O... widths) { tableSetColumnWidths(table, litorderedmap(widths)); }