Java JTable Column getTableColumn(JTable table, int columnIndex)

Here you can find the source of getTableColumn(JTable table, int columnIndex)

Description

get Table Column

License

MIT License

Declaration

public static TableColumn getTableColumn(JTable table, int columnIndex) 

Method Source Code


//package com.java2s;
/*!//  w ww.j  av a  2s .co  m
 * mifmi-commons4j
 * https://github.com/mifmi/mifmi-commons4j
 *
 * Copyright (c) 2015 mifmi.org and other contributors
 * Released under the MIT license
 * https://opensource.org/licenses/MIT
 */

import javax.swing.JTable;
import javax.swing.table.TableColumn;

public class Main {
    public static TableColumn getTableColumn(JTable table, int columnIndex) {
        if (table == null) {
            throw new NullPointerException();
        }

        String columnName = table.getColumnName(columnIndex);
        if (columnName == null) {
            return null;
        }

        TableColumn column = table.getColumn(columnName);

        return column;
    }
}

Related

  1. getColumnOrder(final JTable table)
  2. getColumns(TableColumnModel columnModel)
  3. getMultiLineColumnNames(String[] ret)
  4. getRealColumnPos(int colPos, JTable table)
  5. getRenderedComponentAt(JTable table, int row, int column)
  6. hideColumn(JTable table, int columnIndex)
  7. installDelegatingColumn(TableColumn column, String label)
  8. isColumnDefinitionChange(TableModelEvent e)
  9. isColumnSorted(JTable table, int column)