I put my resources in a package in the src folder, usually a subfolder, but at least something I can get to via a "../" or two if needed.
For example in the SimplexTexture tutorial I am working on, I have a packages called:
com.adonax.tutorial (for the code)
com.adonax.tutorial.images (for the images)
Code in the tutorial area (TutorialFramework is a class in this source folder) that loads a resource image would form the URL form as in the following:
URL introURL = TutorialFramework.class.getResource(
I think this method is consistent with what is presented in the Java Tutorials. There is a description of resource loading under the topic of icons (go figure) that wasn't easy for me to find but I now have bookmarked:http://docs.oracle.com/javase/tutorial/uiswing/components/icon.html
See the section titled "Loading Images using getResource" about 1/3rd of the way down.
I don't know that this is best
, only that it works for me.
Second note: I've never had much success with selecting export to "Runnable JAR file", and always the first option "JAR file". I confess I haven't bothered to learn the significance of the distinction, since the "JAR file" option works fine.
In general, I've found URLs to be the most reliable way to identify various files and resources, especially since subfiles in a compressed jar are kind of a special case and the File command can't necessarily peek inside a compressed file.
P.S., the author of "cokeandcode" is pretty reliable. I didn't look at his suggestions in this instance, but I'm betting there are good suggestions there.