How to crate a source folder with images and then use them in that same project? I have an "image" folder in src and I indicated that it is a source folder via build-path. I tried like a million ways to put those images on my JFrame-JLabels but none of them seems to work(it does with absolute path).What is the best way to do that?Relative path needed...
Asked
Active
Viewed 615 times
1 Answers
0
Make a resource folder. Call it "res" or whatever you want. Or you can make a method which sets directory already to folder you want and you just input file name
img = imageName.png
buffImg = ImageIO.read(new File("C:\Project\src\images\" + img));

0x2B
- 91
- 9
-
lol so basically this.. http://stackoverflow.com/questions/14209085/how-to-define-a-relative-path-in-java ? – 0x2B May 12 '15 at 02:51
-
Nah dont apologize, happens to the best of us – 0x2B May 12 '15 at 21:06