Monday 15 June 2015

java - How do I recreate the width of columns in a JTable after changing the ColumnModel -



java - How do I recreate the width of columns in a JTable after changing the ColumnModel -

so have jtable 24 columns. when table initialized, create set widths of columns , user interface looks great. no complaints. user can click button see 4 of columns. alter array of columns on table model , call

firetablestructurechanged()

which removes of column widths established (but shows 4 columns, intended behavior). when seek re-defining column widths, nil seems change.

this utilize set column widths

tablecolumnmodel columnmodel = table.getcolumnmodel(); (int = 1; < columnmodel.getcolumncount(); i++) { columnmodel.getcolumn(i).setminwidth(50); columnmodel.getcolumn(i).setmaxwidth(50); }

how columns resize after firetablestructurechanged() gets called?

java swing jtable

No comments:

Post a Comment