Code example for PropertyResourceBundle

0
        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;
    } 
     
    public static String getString(String msg) {
        if (THE_BUNDLE == null) {
Contextual code suggestions in your IDE  Get Codota for Java