I have a folder called Etc which has an image I want to use in another file in the same folder, Example.java. So I have Etc\image.png and Etc\Example.java. I've tried using "Etc/image.png" as the image path, but that didn't work. How should I go about this?
Also, suppose the files were in different packages, how would I do it?
My main .java classes are in a package called Main, for the record.
EDIT:
I used this:
ClassLoader.getSystemClassLoader().getResource("Etc\image.png");