Closed jiaqi20 closed 4 years ago
Does it just not show up in the IntelliJ view window? Because that happens sometimes. You should test out by checking it out on Github itself to view it there.
Ohh thanks for your reply! but I meant like how to get the correct image filepath (files in data folder) to parse and create an Image(filepath) object so that I can do imageView.setImage(Image) to display in the application for jar file testing :'(
I am not sure if my interpretation is correct, but if you would like to put the image in GUI, maybe you can move it to resources/images?
I assume this issue has been resolved. Feel free to reopen if not.
Yes. I solved the issue by adding these paths to the original image path then it works. Thanks everyone for the help!
this.getClass().getProtectionDomain().getCodeSource().getLocation();
to get the location of folder where user saves the jar file
Does anyone know how to get image files (the right image file path to use) from the data folder? I was able to write the images that were downloaded using URL into the local data folder which has the same directory as jar file but couldn't retrieve them to display in the application.
I tried using ("data/" + filename) as the image path but doesn't seem to work.