I'm trying to load an image into my java application as a BufferedImage, with the intent of having it work in a JAR file. I tried using ImageIO.read(new File("images/grass.png"));
which worked in the IDE, but not in the JAR.
I've also tried
(BufferedImage) new ImageIcon(getClass().getResource(
"/images/grass.png")).getImage();
which won't even work in the IDE because of a NullPointerException. I tried doing it with ../images, /images, and images in the path. None of those work.
Am I missing something here?