2
awt.Graphics
을 사용하여 메뉴를 만들고 있는데 그림을 그릴 때 IIOException
이 이상하게 들립니다. 이미지를 찾지 못한 프로그램 때문입니까? 다음은 내 코드가 사용 된 방법입니다.BufferedImage 인스턴스의 배열 : IIOException
javax.imageio.IIOException: Can't read input file!
어떤 제안 :
public static BufferedImage[] img;
//this is where img[] gets initialized
for (int j = 0; j < worlds.length; j++) { //say worlds is about 3 or so
String tmp = worlds.get(j);
tmp = tmp.replace(".WORLD", "");
img[j] = ImageIO.read(new File("C:\Users\Bryce\Desktop\" + tmp + ".png"));
}
//this is where it gets drawn
for (int i = 0; i < worlds.size(); i++) {
String tmp = worlds.get(i);
tmp = tmp.replace(".WORLD", "");
try {
for (int j = 0; j < worlds.size(); j++) {
img[j] = ImageIO.read(new File("C:\Users\Bryce\Desktop\" + tmp + ".png"));
g.drawImage(img[j], x + 10, y + (ySpace * i), 32, 32, null);
}
} catch(Exception ex) {
ex.printStackTrace();
}
}
것은 나에게 아래의 오류 메시지를주고 계속?