How to clear contents of a jTable ?

前端 未结 8 2304
梦如初夏
梦如初夏 2020-12-05 05:41

I have a jTable and it\'s got a table model defined like this:

javax.swing.table.TableModel dataModel = 
     new javax.swing.table.DefaultTableModel(data, c         


        
8条回答
  •  余生分开走
    2020-12-05 06:04

    One of the trivial methods is to use the following option.

    dataModel.setRowCount(0);
    

    dataModel is the model which you would like clear the content on

    However, it is not optiomal solution.

提交回复
热议问题