Java JTable Column getColumns(TableColumnModel columnModel)

Here you can find the source of getColumns(TableColumnModel columnModel)

Description

get Columns

License

Open Source License

Declaration

public static List<TableColumn> getColumns(TableColumnModel columnModel) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;

public class Main {
    public static List<TableColumn> getColumns(TableColumnModel columnModel) {
        List<TableColumn> tablecolumns = new ArrayList<TableColumn>(
                columnModel.getColumnCount());
        for (int columnIndex = 0; columnIndex < columnModel
                .getColumnCount(); columnIndex++) {
            tablecolumns.add(columnModel.getColumn(columnIndex));
        }//from   w  w  w .  j  av a2  s.  c  om

        return tablecolumns;
    }
}

Related

  1. getColumnData(final JTable table, final int iSelectedRow)
  2. getColumnIndex(JTable table, String columnTitle)
  3. getColumnIndexFromName(TableModel tableModel, String columnToRemove)
  4. getColumnNames(TableModel tableModel)
  5. getColumnOrder(final JTable table)
  6. getMultiLineColumnNames(String[] ret)
  7. getRealColumnPos(int colPos, JTable table)
  8. getRenderedComponentAt(JTable table, int row, int column)
  9. getTableColumn(JTable table, int columnIndex)