File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Abilities of ResourceBundle" Watch "Abilities of ResourceBundle" New topic

Abilities of ResourceBundle

zaeem masood ashar
Ranch Hand

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

rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
check the API at
Suppose we have a PropertyResourceBundle ''. This ResourceBundle contains the keys 'key1' and 'key2'.
ResourceBundle resb = ResourceBundle.getBundle(test);
String keyValue1 = (String)resb.getObject(this.key1);
String keyValue2 = (String)resb.getObject(this.key2);
catch(MissingResourceException e)

Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
It is sorta covered in the JavaRanch Style Guide.
subject: Abilities of ResourceBundle
Similar Threads
read a properties file
Resource bundle or Properties
refresh ResourceBundle contents
store config data in xml
PropertyResourceBundle and EL