Your own Resource Bundle based on ListResourceBundle
import java.awt.*;
import java.util.*;
public class SampleResourceBundle extends ListResourceBundle {
public Object [][] getContents() {
return contents;
}
static final Object [][] contents = {
{"okButton", new Button("OK")},
{"negativeInteger", new Integer(-1)},
{"textString", "Thank you for reading our book"}
};
}
/////////
public class SimpleResourceBundle_it extends SimpleResourceBundle {
public Object handleGetObject(String key) {
if (key.equals("AMMessage")) return "Buona mattina";
if (key.equals("PMMessage")) return "Buona sera";
return null;
}
}
/////////
Related examples in the same category