I try to set width for the columns, but it didn't work at all, I have been searching for answers for hours, and here is my code, can anyone tell me what is the problem. Thanks in advance.
String [] columns = {"Day","StratTime","EndTime","Description"};
mtbl = new DefaultTableModel();
tbl = new JTable(mtbl);
jsPane = new JScrollPane(tbl);
tbl.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
for (int i = 0; i < Timedcolumns.length; i++) {
mtbl.addColumn(columns[i]);
tbl.getColumnModel().getColumn(i).setPreferredWidth(100);
}