Text Bundle : ListResourceBundle « I18N « Java Tutorial






import java.util.ListResourceBundle;

class TextBundle extends ListResourceBundle {
  public Object[][] getContents() {
    return contents;
  }

  static final Object[][] contents = { { "dog", "dog" }, { "cat", "cat" }, { "horse", "horse" },
      { "cow", "cow" }, { "elephant", "elephant" } };
}

class TextBundle_es extends ListResourceBundle {
  public Object[][] getContents() {
    return contents;
  }

  static final Object[][] contents = { { "dog", "perro" }, { "cat", "gato" },
      { "horse", "caballo" }, { "cow", "vaca" }, { "elephant", "elefante" } };
}








13.5.ListResourceBundle
13.5.1.Text Bundle
13.5.2.List Resource bundle