Java tutorial
//package com.java2s; //License from project: Apache License import javax.swing.*; import javax.swing.table.TableColumnModel; public class Main { public static void setMaxnimumColumnWidths(final JTable table, final int... widths) { TableColumnModel columnModel = table.getColumnModel(); for (int col = 0; col < widths.length; col++) { columnModel.getColumn(col).setMaxWidth(widths[col]); } } }