This is a question that has been asked like 100 times on this site, but I have looked at all of them and even though they all were solved, none of the solutions worked for m
I had the exact same problem. I used the path "my_image.png" at first but it did not work, so I searched everywhere and tried the other solutions posted on this site but none of them worked. I solved mine by changing my code from this
image = ImageIO.read(SpriteSheet.class.getResourceAsStream("res/image.png"));
to this
image = ImageIO.read(SpriteSheet.class.getResourceAsStream("/image.png"));
I hope this helps, even though this question was posted 5 years ago.