Java JTable Column ponerAncho(TableColumn loColumn, int plAncho)

Here you can find the source of ponerAncho(TableColumn loColumn, int plAncho)

Description

poner Ancho

License

Open Source License

Declaration

public static void ponerAncho(TableColumn loColumn, int plAncho) 

Method Source Code


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

import javax.swing.table.TableColumn;

public class Main {
    public static void ponerAncho(TableColumn loColumn, int plAncho) {
        if (plAncho == 0) {
            //invisibles las 2 primeras columnas
            loColumn.setMinWidth(0);/* w  ww  .  j  a  v  a  2s . co  m*/
            loColumn.setPreferredWidth(0);
            loColumn.setWidth(0);
            loColumn.setMaxWidth(0);
        } else {
            loColumn.setPreferredWidth(plAncho);
            loColumn.setWidth(plAncho);
        }

    }
}

Related

  1. layoutColumns(JTable p_Table, boolean p_OnlyVisibleRows)
  2. loadToTableModel(String fileName, Object[] columns)
  3. makeTablePanel(int rows, int cols, int mainColumn, JComponent components[])
  4. newTable(String name, Object[][] rowData, Object[] columnNames)
  5. pack(JTable table, boolean packColumns, boolean packRows, int padding)
  6. removeColumn(int index, JTable table)
  7. selectByTyping(JTable table, javax.swing.JTextField textfield, int column)
  8. setColumnOrder(final JTable table, final String positions)
  9. setearPrimerRegistro(JTable pTabla, JTextField pTextoDeBusqueda, int pColumna)