Here you can find the source of setColumnWidth(JTable table, int columnIdx, int width)
static public void setColumnWidth(JTable table, int columnIdx, int width)
//package com.java2s; //License from project: LGPL import javax.swing.JTable; import javax.swing.table.TableColumn; public class Main { static public void setColumnWidth(JTable table, int columnIdx, int width) { TableColumn o = table.getColumnModel().getColumn(columnIdx); o.setWidth(width);//from www .j a v a 2 s . c o m o.setMaxWidth(width); o.setMinWidth(width); } }