Java tutorial
import java.util.Enumeration; import javax.swing.JTable; import javax.swing.table.TableColumn; public class Main { public static void main(String[] argv) throws Exception { } public TableColumn[] getColumnsInView(JTable table) { TableColumn[] result = new TableColumn[table.getColumnCount()]; // Use a for loop for (int c = 0; c < table.getColumnCount(); c++) { result[c] = table.getColumnModel().getColumn(c); } return result; } }