imageio.IIOException: Can’t read input file

Have you tried using new File("logo.jpg"); (without the leading /)?

And are you sure, the logo.jpg is copied to your output? (Some IDEs don’t copy every file from your source-directories to your output (or target) directories.)

/src
|-> Window.java
|-> Logo.jpg

becomes

/out
|-> Window.class

(Note that the IDE/compiler does not copy the image to your output-directory and so the compiled code cannot find the image – allthough you did specify the correct path)

Leave a Comment