I have a snake game written in java but when I export the project as Runnable Jar, the images do not load. They work fine in eclipse. What is the problem?
My loadImages method looks as following:
private void loadImages() {
ImageIcon snakeBlockIcon = new ImageIcon("snake/images/snakeBody20px.png");
snakeBlockImage = snakeBlockIcon.getImage();
snakeBlockImage = snakeBlockImage.getScaledInstance(DOT_SIZE, DOT_SIZE, Image.SCALE_DEFAULT);
...
My project is structured as following:
(SourceFolder)Projects > (source package) snake > (package) images
(SourceFolder)Projects > (source package) snake > (package) snake > .java files
Thank you!
EDIT: earned enough rep to post the image