JTable hide and show columns

后端 未结 6 891
南旧
南旧 2021-01-11 13:03

I want to add some columns to a table (Swing JTable). Some of them will have a default size (e.g. 250), others will be hidden (so their size will be 0). I use this code:

6条回答
  •  既然无缘
    2021-01-11 13:34

    instead of re-inventing the wheel you might consider to use JXTable (in the SwingX project) which supports hidden columns, comlete with a ui-control to allow users hiding/showing them dynamically - and a bunch of other useful thingies :).

提交回复
热议问题