I have a JTable built using DefaultModel which is displayed in JPane but I would like to re-size the table to make it bigger. Could any one please explain how I could do that? I have tried the following code:
TableColumnModel colsize = t1.getColumnModel();
for(int i=0; i<cols; i++){
colsize.getColumn(i).setPreferredWidth(200);
}
but it did not work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…