force JTable Column Width - Java Swing

Java examples for Swing:JTable Column

Description

force JTable Column Width

Demo Code


//package com.java2s;
import javax.swing.table.TableColumn;

public class Main {
    public static void forceColumnWidth(TableColumn column, int columnWidth) {
        column.setMinWidth(columnWidth);
        column.setMaxWidth(columnWidth);
        column.setWidth(columnWidth);/*ww w .  j  av  a 2 s .co m*/
    }
}

Related Tutorials