Java JTable Column cloneTableColumn(TableColumn c)

Here you can find the source of cloneTableColumn(TableColumn c)

Description

clone Table Column

License

Open Source License

Declaration

public static TableColumn cloneTableColumn(TableColumn c) 

Method Source Code

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

import javax.swing.table.TableColumn;

public class Main {
    public static TableColumn cloneTableColumn(TableColumn c) {
        TableColumn result = new TableColumn(c.getModelIndex(), c.getPreferredWidth(), c.getCellRenderer(),
                c.getCellEditor());/*from   ww w. j  ava 2 s  . c o  m*/
        result.setMaxWidth(c.getMaxWidth());
        result.setMinWidth(c.getMinWidth());
        result.setResizable(c.getResizable());
        result.setHeaderValue(c.getHeaderValue());
        result.setHeaderRenderer(c.getHeaderRenderer());
        result.setIdentifier(c.getIdentifier());
        return result;
    }
}

Related

  1. aceptarTeclaPresionada(KeyEvent e, JTable pTabla, JTextField pTextoDeBusqueda, int pColumna)
  2. addSpaceSelection(final JTable table, final int column)
  3. ajustarAnchoColumnas(JTable table)
  4. buscarDescripcion(KeyEvent e, JTable pTabla, JTextField pTextoDeBusqueda, int pColumna)
  5. cloneTableColumnModel(TableColumnModel m)
  6. columnAt(final JTable table, final Point p, final Class columnClazz)
  7. convertColumnIndexToModel(TableColumnModel cm, int viewColumnIndex)
  8. convertColumnIndexToView(TableColumnModel model, int modelCol)