Better way to load resources from resource-only package
Hello,
I've got a package, res, which is said to contain all the resources of my application. To easily load them, I have a class inside that package, with only this code:
Code:
package res;
public abstract class ResLoader {
}
Then what I do to load resources from any other class is:
Code:
ResLoader.class.getResource(resourceName);
Am I wrong or there is a better way to do this?
Re: Better way to load resources from resource-only package
You can also specify the absolute path for your resources: /res/YourResource and use any Class object you want.
kind regards,
Jos