0

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...

1 Answers1

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