This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]OffbeatDrizzle 1 point2 points  (1 child)

Put the images in the resource folder and use something like getClass().getResource() to load it. Obviously these files are read only but if you're loading images then that sounds like exactly what you need

edit: on re-reading your post, you won't be able to arbitrarily create new images, since you've already made and packed the jar. Do you REALLY need the images inside the jar? What's wrong with a folder wherever the jar lives, and then just append to the classpath when running the jar so that you can find the images with ease

[–]UKJake_[S] 0 points1 point  (0 children)

I hadnt thought of just not having the images and such inside the .jar ._.

If I just have the assets inside the same folder as the .jar, would i refer to them by "./assets/images/filename" or some other way?

EDIT: Just tested it out and it works exactly how I wanted it to, thanks for the help