I am trying to load a background into my JFrame using the following code:
image = ImageIO.read(getClass().getResourceAsStream(s));
where for si tried:
/res/Background/bg_menu.gif
Background/bg_menu.gif
/Background/bg_menu.gif
res/Background/bg_menu.gif
My res folder is at the root of the project like this:
Game
-- src
-- res
I have done the following:
Project Properties -> Sources -> Add Folder -> res
The error I am getting is:
java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(ImageIO.java:1348)
at com.game.rpg.tilemap.Background.<init>(Background.java:29)
at com.game.rpg.gamestate.MenuState.<init>(MenuState.java:34)
source
share