posted 19 years ago
hi,
u can alter ur column width like this
....Code......
where jTbl is ur JTabel object
TableColumn hdr = jTbl.getTableHeader().getColumnModel().getColumn(
0);
hdr.setPreferredWidth(0);
hdr.setMaxWidth(0);
hdr.setMinWidth(0);
hdr.setWidth(0);
TableColumnModel cModel = jTbl.getColumnModel();
cModel.getColumn(0).setMaxWidth(0);
cModel.getColumn(0).setMinWidth(0);
cModel.getColumn(0).setWidth(0);
cModel.getColumn(0).setPreferredWidth(0);
....ur u an also get column by using column name from column model and then alter it
int index = jTbl.getColumnModel().getColumnIndex(
"Ur cloumn name");