Java examples for Swing:JTable Column
column JTable Header Width
//package com.java2s; import java.awt.Component; import javax.swing.JTable; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; public class Main { static private int columnHeaderWidth(JTable l_Table, TableColumn col) { TableCellRenderer renderer = l_Table.getTableHeader() .getDefaultRenderer();// w ww .j ava 2s .com Component comp = renderer.getTableCellRendererComponent(l_Table, col.getHeaderValue(), false, false, 0, 0); return comp.getPreferredSize().width; } }