Skip to main content
gamedev.net
🔒 Locked

[java] Resource Bundle

Started by role Apr 16, 2003 at 6:22 AM 1 replies 300+ views
Original Post
role
role
can i put resource bundle in different folder from the class base folder? and how to get the bundle?
-vic-
-vic-
To get the Bundle you should do:


ResourceBundle resource = ResourceBundle.getBundle(BASENAME, locale);


If you want to put it in a different path from your class base, i think you just need to pass the correct path as the BASENAME.

Victor.
c[_]~~
c[_]~~
role
role
okay i''ve solved this..

i do it like this:

MyResource class must be in package resources
package resources;

and load it using resources.MyResource
ResourceBundle message = ResourceBundle.getBundle("resources.MyResource", myLocale);

the bundle file now can in child directory
(parent directory/resources/MyResource.class)

okey, thanx anyway

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.