出现这样的错误如何解决javax.imageio.IIOException:Can'treadinputfile!atjavax.imageio.ImageIO.read(UnknownSource)atorg.liky.mario.StaticValue.init(StaticValue.java:30)atorg...
出现这样的错误如何解决javax.imageio.IIOException: Can't read input file!at javax.imageio.ImageIO.read(Unknown Source)at org.liky.mario.StaticValue.init(StaticValue.java:30)at org.liky.mario.MyFrame.(MyFrame.java:32)at org.liky.mario.MyFrame.main(MyFrame.java:21)javax.imageio.IIOException: Can't read input file!at javax.imageio.ImageIO.read(Unknown Source)at org.liky.mario.StaticValue.init(StaticValue.java:73)at org.liky.mario.MyFrame.(MyFrame.java:32)at org.liky.mario.MyFrame.main(MyFrame.java:21)javax.imageio.IIOException: Can't read input file!at javax.imageio.ImageIO.read(Unknown Source)at org.liky.mario.StaticValue.init(StaticValue.java:73)at org.liky.mario.MyFrame.(MyFrame.java:32)at org.liky.mario.MyFrame.main(MyFrame.java:21)Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 9, Size: 0at java.util.ArrayList.RangeCheck(Unknown Source)at java.util.ArrayList.get(Unknown Source)at org.liky.mario.Obstruction.setImage(Obstruction.java:33)at org.liky.mario.Obstruction.(Obstruction.java:20)at org.liky.mario.BackGround.(BackGround.java:33)at org.liky.mario.MyFrame.(MyFrame.java:35)at org.liky.mario.MyFrame.main(MyFrame.java:21) 我用的是MyEclipse6.5public static String imagePath=System.getenv("user.dir")+"/bin/";//将全部的图片初始化public static void init(){ //将所有主角的图片保存到静态的属性中 for (int i=1;i<=2;i++){ try { allSheepImage.add(ImageIO.read(new File(imagePath+i+".gif"))); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace();图片保存在C:\Documents and Settings\WWW-5D09ADF20DA\workspace\Sheep Fighter\bin请问是哪里出错了
展开