This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Abilities of ResourceBundle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Abilities of ResourceBundle" Watch "Abilities of ResourceBundle" New topic
Author

Abilities of ResourceBundle

zaeem masood ashar
Ranch Hand

Joined: Mar 17, 2001
Posts: 54
Hi
Can anyone tell me the how the ResourceBundle of the Java.util package accesses properties from a .properties file?? What exactly happens??
Thanks


SCJP2
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
check the API at http://java.sun.com/j2se/1.3/docs/api/index.html
Suppose we have a PropertyResourceBundle 'test.properties'. This ResourceBundle contains the keys 'key1' and 'key2'.
try
{
ResourceBundle resb = ResourceBundle.getBundle(test);
String keyValue1 = (String)resb.getObject(this.key1);
String keyValue2 = (String)resb.getObject(this.key2);
}
catch(MissingResourceException e)
{
e.printStackTrace();
}


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Abilities of ResourceBundle
 
Similar Threads
refresh ResourceBundle contents
Resource bundle or Properties
PropertyResourceBundle and EL
read a properties file
store config data in xml