Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1这算什么?帮忙看看阿,谢谢。

解决方案 »

  1.   

    下标越界.看你的数组或者list
      

  2.   

    数组越界,有可能是你的数组被填入了大于它的size数目的对象~~
      

  3.   

    delElement = this._mf.getTable_Student().getValueAt(delRow,1).toString();
    在这句报的错
    (delRow = this._mf.getTable_Student().getSelectedRow();)
      

  4.   

    delRow 有可能只有0或1个元素?
      

  5.   

    delElement = this._mf.getTable_Student().getValueAt(delRow,1).toString();
    在这句报的错
    (delRow = this._mf.getTable_Student().getSelectedRow();)这里哪来的数组阿而且我还有一段相同的代码就没问题。
      

  6.   

    this._mf.getTable_Student(). 是得到一个字符串吧,还是不跟数组一样,下标越界了。
      

  7.   

    this._mf.getTable_Student()得到的是一个jtable
      

  8.   

    delElement = this._mf.getTable_Student().getValueAt(delRow,1).toString();
    那可能是参数(delRow,1)有越界吧,你看看你得到的这个Jtable到底是几行几列吧!
      

  9.   

    delRow = this._mf.getTable_Student().getSelectedRow()这个怎么可能越界?是通过鼠标点击jtable的行获得的行号阿。而且我的jtable是三列的所以1也在范围内。
      

  10.   

    数组越界
    就是说你数组里面只有10个数
    而你却想取这个数组中的第11个数时就会抛出ArrayIndexOutOfBoundsException异常
      

  11.   

    看看这个,你的问题和这个一样。会出现同样的异常:数组越界。
    public class Test {
    public static void main(String[] args){
     int size = 10;
     int[] ints = new int[size];
     for(int i = 0;i<=ints.length;i++)
     {
    ints[i] = i ;
    System.out.println(ints[i]);
     }
     System.out.print(ints.length);
    }
    }
      

  12.   

    to: july1732() 你看仔细了,你的代码里是<=,不越界才怪呢。