Java examples for Swing:JTable Column
configure JTable Column
//package com.java2s; import javax.swing.JTable; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; public class Main { public static void configureColumn(JTable table, int columnNumber, Integer width, TableCellRenderer renderer, TableCellEditor editor) { TableColumn column = table.getColumnModel().getColumn(columnNumber); if (width != null) column.setMaxWidth(width);/*w ww.ja v a2 s .c o m*/ if (renderer != null) column.setCellRenderer(renderer); if (editor != null) column.setCellEditor(editor); } }