java.lang.IllegalArgumentException: input == null! when using ImageIO.read to load image as bufferedImage

Try using this:-

this.icon = ImageIO.read(new FileInputStream("res/test.txt"));

where res folder is present at the same level as your src folder. Also, if you notice, the slash / before the res folder name was removed.

Leave a Comment