Because i don't understand the problem i don't know how to ask a good question. But i simply want to resize the columns in JTable. I use JTable and DefaultTableModel class to create the columns, but some columns take to much space, for example check buttons. I wonder if someone knows how to minimize these columns programmatically.
Here is some code i use
public static final String[] COLUMNS = {"Närvaro / Frånvaro", "Deltagare", "Ärendenummer", "Avvikelse"};
private CheckBoxDefaultTableModel model = new CheckBoxDefaultTableModel(COLUMNS, 0);
private final JTable table = new JTable(model);
class CheckBoxDefaultTableModel extends DefaultTableModel {
private List<String> removedItemsList = new ArrayList<String>();
public CheckBoxDefaultTableModel(Object[] columnNames, int rowCount) {
super(columnNames, rowCount);
}
Object[] row = {Boolean.FALSE, namn, caseNbr, null};
I don't have reputation to add a picture of my program, but it looks like in this link: