java.lang.ArrayIndexOutOfBoundsException: 0 >= 0 attempting to populate JTable

前端 未结 10 1633
猫巷女王i
猫巷女王i 2020-12-20 13:37

I\'m subclassing JTable and using a DefaultTableModel to model my table data. The following class sets up the JTable, and adds one row to the model.

import          


        
10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-20 14:26

    Replace your code with the following Here you need to remove first row only that should be iterated for all the rows

    private void refreshTable() {
    
       int rowCount= model.getRowCount();
    
      // System.out.println(rowCount);
    
       for(int i=0;i

提交回复
热议问题