package th.co.muangthai.endrprint.util; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; public class MessageUtil{ private static Properties prop; static { prop = new Properties(); try { prop.load(MessageUtil.class.getResourceAsStream("/message.properties")); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static String getSaveSuccess() { return prop.getProperty("msg.save.success"); } public static String getDeleteSuccess() { return prop.getProperty("msg.delete.success"); } public static String getDeleteNonSelected() { return prop.getProperty("msg.delete.nonselected"); } public static String getError() { return prop.getProperty("msg.error"); } public static String getMessage(String key) { return prop.getProperty(key); } public static String getTitle() { return prop.getProperty("title.template"); } public static String getDailyTitle() { return prop.getProperty("daily.title.template"); } }