Java examples for Swing:JTable Column
set JTable Columns Width
//package com.java2s; import javax.swing.JTable; import javax.swing.table.TableColumn; public class Main { public static void setJTableColumnsWidth(JTable table, int... widths) { for (int i = 0; i < table.getColumnModel().getColumnCount(); i++) { TableColumn column = table.getColumnModel().getColumn(i); column.setPreferredWidth((int) widths[i]); }/*from www. j av a2 s . c o m*/ } }