When I run the app from netbeans, all is well.
When I run the app from the command line inside the dist folder, the resources don't load up at all.
I've moved all the library files and resources (images and models) into the dist folder. And they are referenced properly. I use the same class path as what I have configured in netbeans, yet any time i do this:
URL urlManifestFile = ResourceManager.class.getClassLoader().getResource(this.strManifestFile);
that ends up being null. and using it returns the null pointer exception.
I found one solution which seemed to work, I only partially copied that around to the various url sections, but after doing so, while it sort of worked from the commandline, it no longer worked in netbeans. help! :S
All the initial resources are inside the jar anyway? To add extra files to that dirextory or get files from ouside of the jar, I'm not sure how to do yet.
Edit:- mebe it is better to see what I mean, I don't think I'm very good at explaining things. If you want to download the zip I put in the showcase section, have a look at the Jar file contents, the way I have structured the directories. The code I posted above apllies to that.
To fix this problem I set up my porjects directory structure so that when you open the jar file you see the project folder and the META-INF, Inside the project folder you have your Main class. In my case this is called Game1Main, then all the projects subdirectories. Anytime I need to get a resource I use the Main class's classloader(don't know if that is the correct way of saying this) and start from the project folder on wards
"projectfolder/resources/textures/etc…"
example
Texture north = TextureManager.loadTexture(
Game1Main.class.getClassLoader().getResource(
"Game1/Sources/Textures/4.jpg"),
Texture.MinificationFilter.BilinearNearestMipMap,
Texture.MagnificationFilter.Bilinear);
also you can use the ResourceLocatorTool, personally I just use this for things like MD5 models, where it may have multiple texture files being delt with in the .mtl file
ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE,
new SimpleResourceLocator(Game1Main.class.getClassLoader()
.getResource("Game1/Sources/Textures/")));
You can swap out the SimpleResourceLocator for MultiForamtLocator if your expecting diff types of file extensions.
So I shouldn't add a folder to the library and expect that i can put files inside to be read? That I have to add the whole resource section as a jar file? How do I update specific files? How do I do that from a java program?