I am attempting to set an image to a JLabel and within my project I have a folder "images", within that is the logo.png
I am using the following code to get it
BufferedImage myPicture = null;
try {
myPicture = ImageIO.read(new File("images/logo.png"));
} catch (IOException e1) {
e1.printStackTrace();
}
JLabel headerImage = new JLabel(new ImageIcon(myPicture));
This works file within eclipse, however outside the runnable jar wont fire unless it is in the same directory as the folder images with the logo file within.
So my question is how can i pack the image within the .jar file and have this code reference it?