Mixing code and resources together is obviously messy.
If you really think this is a problem, put the resources file in the root source folder. You will then have one or more file trees with the source / class files, and one file tree with the resources.
Eclipse copies the resources to the bin folder as well... real bad
Why is that bad? The resources need to be located relatively to the class files. After all, it's the class files you'll be distributing, usually as one or more JAR files. Yes, you'll have the same files in two locations, but as long as you don't touch the ones in the bin folder that shouldn't be a problem.
So... where do I put my resources folder and how do I get a hold of MyResource.png? And needless to say: it should work in a JAR too.
Well, in the bin folder; either as a direct folder (in which case you need to use "/resources/MyResource.png") or relative to the class. That way, when you create your JAR file, you include everything in the bin folder, including the resources.
The "Eclipse copies the resources to the bin folder" isn't that big of a deal for my case since my resources don't take much space. But I imagine this could be an issue for laaaaaaaarge scale programs (you know... like RuneScape or something).
I mainly just want to know if there's a conventional way of dealing with resources. Because if there is then I'd rather stick to the conventions.
The existence of the "getResource" method in basic classes like Class and ClassLoader suggests to me that putting the resources in the classpath (which is what they essentially implement) is the conventional way.
And if you distribute your application in a jar file (another conventional way of doing things) then having the resources inside the jar is the simplest and most obvious thing to do.
If it is a lot of resources that is needed, such as images and stuff, I sometimes divide it into two projects, say MyApp that produce the MyApp.jar and the MyAppResources that produces the MyAppResources.jar.
Then it is quite possible to just create a copy of MyAppResources when you need to do a new skin on the app and just switch the resource-jars. Sometimes we even have language specific resources in language coded projects, i.e. MyAppResources holds the base language and MyAppResourcesSE holds everything that has to do with the Swedish version.
In the end, it is all down to where to find the resources in the classpath.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com