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

前端 未结 5 413
星月不相逢
星月不相逢 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:13

    You manipulate the getValueAt , getColumnCount to achieve this.

    So for example the getColumnCount you give it as 3

    and on getValueAt - to skip if the column index is above the skipped column

    JTable will first call getColumnCount and getRowCount and fetch calling getValueAt for each of the cells.

    NOTE: Ignore this and see link by trashgod below.

提交回复
热议问题