I'm trying to load a single JLabel set with an ImageIcon for display. It works fine when I compile it within my IDE, but when I export the image will not show up. Here's the code I'm using to set the image.
ImageIcon icon = new ImageIcon("test.png");
JLabel label = new JLabel(icon);
I know I asked a question along the same lines as this last time, so I tried "getClass().getResource(...)", but that's been throwing an error at me. What do I need to do with this JLabel to get that image to show even when I export? I'd like the image to be part of the JAR package, as this entire thing is supposed to be something of a surprise.