Here you can find the source of setMaxnimumColumnWidths(final JTable table, final int... widths)
public static void setMaxnimumColumnWidths(final JTable table, final int... widths)
//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]); }/* ww w .j ava2s. c o m*/ } }