Java:Removing all the rows of DefaultTableModel

后端 未结 6 1487
盖世英雄少女心
盖世英雄少女心 2020-11-27 07:58

I want to delete all the rows of DefaultTable.I found two common ways to delete them on internet but none of them works in my case because those methods does not exist in my

6条回答
  •  情书的邮戳
    2020-11-27 08:31

    Ypu can write a method

    public void clearTable()
      {
        getTableModel().setRowCount(0);
      }
    

    then call this method from the place that you need to clear the table

提交回复
热议问题