-1

I'm making a game where you fight a stick guy, and I'm already having errors trying to paint the background image.

Here is my code: (I'm actually the worst with these code block things, it's not pasting right for some reason, here's a pastebin: http://pastebin.com/PcYYsQVY )

And here is the error I'm getting:

javax.imageio.IIOException: Can't read input file!
        at javax.imageio.ImageIO.read(Unknown Source)
        at me.Joey402.StickFrame.main(StickFrame.java:21)

Before when working with applets on a different project, the images were in the same spot as they were in this project and it was working, but in this project I'm getting this error for some reason.

Thanks in advance.

Joey402
  • 3
  • 4
  • you should atleast do a search in so. before asking a question. http://stackoverflow.com/questions/13130982/imageio-cant-read-input-file this question was solved already – Priyamal Apr 30 '16 at 04:36

1 Answers1

0

Your file does not exist. At least not in the relative path your program is looking for it.

Check file existance from the program via File.exists, and give yourself some further analysis information via getAbsolutePath.

File file = new File("whatever");
if(!file.exists()) {
   System.err.println("my file is not there, I was looking at " + file.getAbsolutePath());
}
mtj
  • 3,381
  • 19
  • 30