How to hide a particlar column in DefaultTableModel from displaying it in table?

前端 未结 5 421
星月不相逢
星月不相逢 2020-12-21 11:31

I am using Java Swingx framework. I have 4 columns in my DefaultTableModel object. I wish to display only 3 of the columns. But, I need all four for computing.<

5条回答
  •  旧巷少年郎
    2020-12-21 12:11

    You can hide it by setting its width to 0.

    _table.getColumn("ID").setPreferredWidth(0);
    _table.getColumn("ID").setMinWidth(0);
    _table.getColumn("ID").setWidth(0);
    _table.getColumn("ID").setMaxWidth(0);
    

提交回复
热议问题