Here you can find the source of getColumnNames(TableModel tableModel)
Parameter | Description |
---|---|
tableModel | a parameter |
public static String[] getColumnNames(TableModel tableModel)
//package com.java2s; //License from project: Open Source License import javax.swing.table.TableModel; public class Main { /**/*w ww. jav a 2 s. c o m*/ * @param tableModel * @return the list of column names of a table */ public static String[] getColumnNames(TableModel tableModel) { int size = tableModel.getColumnCount(); String[] columnNames = new String[size]; for (int i = 0; i < size; i++) { columnNames[i] = tableModel.getColumnName(i); } return columnNames; } }