ResourceBundle rb = null;
try {
InputStream in = MsgHelp.class.getResourceAsStream(
RESOURCE_NAME);
rb = new PropertyResourceBundle(in);
} catch (IOException ex) {
Logger.global.warning("Couldn't read resource bundle: " +
ex);
} catch (RuntimeException ex) {
// Shouldn't happen, but deal at least somewhat gracefully.
Logger.global.warning("Couldn't find resource bundle: " +
ex);
}
THE_BUNDLE = rb;
if (THE_BUNDLE == null) {
return msg;
}
try {
return THE_BUNDLE.getString(msg);
} catch (MissingResourceException e) {
return "Missing message: " + msg;
}