FileDocCategorySizeDatePackage
PropertiesDemo.javaAPI DocExample2078Tue Dec 12 18:57:34 GMT 2000None

PropertiesDemo

public class PropertiesDemo extends Object

Fields Summary
Constructors Summary
Methods Summary
static voiddisplayValue(java.util.Locale currentLocale, java.lang.String key)


      ResourceBundle labels = 
         ResourceBundle.getBundle("LabelsBundle",currentLocale);
      String value  = labels.getString(key);
      System.out.println(
           "Locale = " + currentLocale.toString() + ", " +
           "key = " + key + ", " +
           "value = " + value);

   
static voiditerateKeys(java.util.Locale currentLocale)


      ResourceBundle labels = 
         ResourceBundle.getBundle("LabelsBundle",currentLocale);

      Enumeration bundleKeys = labels.getKeys();

      while (bundleKeys.hasMoreElements()) {
         String key = (String)bundleKeys.nextElement();
         String value  = labels.getString(key);
         System.out.println("key = " + key + ", " +
           "value = " + value);
      }

   
public static voidmain(java.lang.String[] args)


      Locale[] supportedLocales = {
         Locale.FRENCH,
         Locale.GERMAN,
         Locale.ENGLISH
      };

      for (int i = 0; i < supportedLocales.length; i ++) {
          displayValue(supportedLocales[i], "s2");
      }

      System.out.println();

      iterateKeys(supportedLocales[0]);