Java examples for Swing:JTable Column
register JTable Column Size Listener
//package com.java2s; import java.beans.PropertyChangeListener; import java.util.Enumeration; import javax.swing.JTable; import javax.swing.table.TableColumn; public class Main { public static void registerColumnSizeListener(JTable table, PropertyChangeListener listener) { for (Enumeration<TableColumn> columns = table.getColumnModel() .getColumns(); columns.hasMoreElements();) { TableColumn column = columns.nextElement(); column.addPropertyChangeListener(listener); }/* w w w .j a v a2 s . c o m*/ } }