NetBeans and placing Resources

Hello all…



In order to get NetBeans to work with code like :

TestJmexAudio.class.getResource("/jmetest/data/sound/test.ogg")


You have to put your stuff in the build/classes folder. However, if you use the "Clean & Build" button, all of those folders get wiped away. I was wondering how you all handle your resources in NetBeans? Is there some convenient "Resources" folder that I've been missing this whole time?

-Tyler

Create a simple package / folger e.g. "res" in your Source Packages and put your *.png  … in there

Than you can reference it with

pt.addTexture(new ImageIcon(Engine.class.getClassLoader().getResource("res/grassb.png")), -128, 0, 128);
       


replace Engine with your class name

Hope it helps

No, that's not what I was looking for. I've done that already, but all that is is creating folders in the "build" folder within the NetBeans project.



I need some way to make sure that the resource files get put in the Jar when I build the program…



EDIT: Also, right now when I use the "Build" feature in NetBeans, executing the Jar simply says "Could not find the main class. Program will now exit."

You just need to add your resources folder as a src folder to your project.  That way it will get included into the jar during a build.



Cheers,

Brett

Oh. Quite simple. Thank you!