Here you can find the source of addColumn(JTable table, TableCellRenderer renderer, TableCellEditor editor)
public static TableColumn addColumn(JTable table, TableCellRenderer renderer, TableCellEditor editor)
//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 TableColumn addColumn(JTable table, TableCellRenderer renderer) { return addColumn(table, null, renderer); }/*w w w .j a v a 2s . com*/ public static TableColumn addColumn(JTable table, String header, TableCellRenderer renderer) { return addColumn(table, renderer, null); } public static TableColumn addColumn(JTable table, TableCellRenderer renderer, TableCellEditor editor) { return addColumn(table, renderer, null, editor); } public static TableColumn addColumn(JTable table, TableCellRenderer renderer, String header, TableCellEditor editor) { int nColumns = table.getColumnCount(); TableColumn column = new TableColumn(nColumns); column.setCellRenderer(renderer); column.setCellEditor(editor); column.setHeaderValue(header); table.addColumn(column); return column; } }