void (String... columnNames) { if (columnNames.length != 2) throw new IllegalArgumentException("Invalid number of columns. Expected 2, got " + columnNames.length); myColumnNames = columnNames; TableColumnModel mmodel = getColumnModel(); for (int i = 0; i < columnNames.length; i++) { mmodel.getColumn(i).setHeaderValue(columnNames[i]); } }