How to adjust JTable columns to fit the longest content in column cells

后端 未结 2 1288
野性不改
野性不改 2020-12-01 10:15

I\'m using answer https://stackoverflow.com/a/5820366 and http://tips4java.wordpress.com/2008/11/10/table-column-adjuster/ and it works, but frequently columns\' sizes are t

2条回答
  •  囚心锁ツ
    2020-12-01 10:25

    Set reasonable MinimumWidth for the columns which are too narrow. Then calculate width according to the contents of the columns and set them.

提交回复
热议问题