Java JTable Column Width Set setMaxnimumColumnWidths(final JTable table, final int... widths)

Here you can find the source of setMaxnimumColumnWidths(final JTable table, final int... widths)

Description

set Maxnimum Column Widths

License

Apache License

Declaration

public static void setMaxnimumColumnWidths(final JTable table, final int... widths) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import javax.swing.*;
import javax.swing.table.TableColumnModel;

public class Main {
    public static void setMaxnimumColumnWidths(final JTable table, final int... widths) {
        TableColumnModel columnModel = table.getColumnModel();
        for (int col = 0; col < widths.length; col++) {
            columnModel.getColumn(col).setMaxWidth(widths[col]);
        }/* ww w  .j ava2s.  c  o  m*/
    }
}

Related

  1. setColumnWidths(int[] preferredColWidths, int[] maxColWidths, int[] minColWidths, TableColumnModel columnModel, boolean[] columnsShowing)
  2. setColumnWidths(JTable p_Table, int[] p_ColumnWidths)
  3. setColumnWidths(JTable table, Insets insets, boolean setMinimum, boolean setMaximum)
  4. setColumnWidths(JTable table, Insets insets, boolean setMinimum, boolean setMaximum)
  5. setDefaultColumnWidth(JTable table, int column)
  6. setOptimalColumnWidth(final JTable table, final int col)
  7. SetPreferedColumnWIdth(JTable table, int[] widths)
  8. setPreferredColumnWidths(final JTable table, final float[] columnWeigths, final boolean includeHeader)
  9. setPreferredRowHeights(final JTable table)