IDE's can make this trickier than it need be.
What I tend to do (I use Eclipse, but I'm guessing netBeans is similar) is:
create a directory in the "source" section of my projectadd the new directory to the IDE classpathplace any resource files in it. This enables my code to read the files (using the snippet I posted above) when being
unit tested from the IDE.
Then, for building the deliverable (I use
Ant, I don't know what you use), I add a stanza to copy the contents of the resource folder into the compiled classes directory just before building the final jar, war, or whatever.
Does that help?