TableColumn: setMaxWidth(int maxWidth) : TableColumn « javax.swing.table « Java by API






TableColumn: setMaxWidth(int maxWidth)

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

public class Main {
  public static void main(String[] argv) throws Exception {
    int rows = 3;
    int cols = 3;
    JTable table = new JTable(rows, cols);

    TableColumn col = table.getColumnModel().getColumn(0);
    col.setMinWidth(100);
    col.setMaxWidth(100);
    col.setPreferredWidth(100);

  }
}

   
    
  








Related examples in the same category

1.new TableColumn(int modelIndex)
2.TableColumn: getModelIndex()
3.TableColumn: setCellEditor(TableCellEditor cellEditor)
4.TableColumn: setCellRenderer(TableCellRenderer cellRenderer)
5.TableColumn: setHeaderRenderer(TableCellRenderer headerRenderer)
6.TableColumn: setHeaderValue(Object headerValue)
7.TableColumn: setMinWidth(int minWidth)
8.TableColumn: setPreferredWidth(int preferredWidth)