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

前端 未结 10 1602
猫巷女王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:28

    It is necessary to add isCellEditable method to your table model class with return false.

    @Override
      public boolean isCellEditable(int row, int column)
      {
        return false;
      }
    

提交回复
热议问题