在转换一个得到的文件路径为String时,出现StringIndexOutOfBoundsException,??但可以输出
代码如下:
try{
String path = node.file.getAbsolutePath();
System.out.println(path);//这儿是正常的
tb1.updateTable(path);//这儿调用就能捕获该异常 tb1为我扩展的一个Jtable类的实例。
} catch (StringIndexOutOfBoundsException ex) {
System.out.println(ex);
}报出异常为:java.lang.StringIndexOutOfBoundsException:String Index out of range : -1