Java JTable Column convertColumnIndexToView(TableColumnModel model, int modelCol)

Here you can find the source of convertColumnIndexToView(TableColumnModel model, int modelCol)

Description

convert Column Index To View

License

Open Source License

Declaration

public static int convertColumnIndexToView(TableColumnModel model, int modelCol) 

Method Source Code

//package com.java2s;
// modify it under the terms of the GNU General Public License

import javax.swing.table.TableColumnModel;

public class Main {
    public static int convertColumnIndexToView(TableColumnModel model, int modelCol) {
        if (modelCol < 0)
            return modelCol;
        for (int viewCol = 0; viewCol < model.getColumnCount(); viewCol++) {
            if (model.getColumn(viewCol).getModelIndex() == modelCol) {
                return viewCol;
            }//w w  w. j  av a  2 s . c o m
        }
        return -1;
    }
}

Related

  1. buscarDescripcion(KeyEvent e, JTable pTabla, JTextField pTextoDeBusqueda, int pColumna)
  2. cloneTableColumn(TableColumn c)
  3. cloneTableColumnModel(TableColumnModel m)
  4. columnAt(final JTable table, final Point p, final Class columnClazz)
  5. convertColumnIndexToModel(TableColumnModel cm, int viewColumnIndex)
  6. convertSelectedColumnsToModelIndices(JTable table, int[] columns)
  7. createColumnNames(TableModel model)
  8. createDefaultTableModel(String[] columnNames)
  9. createUneditableTableModel(String... columnNames)