Main.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:uPMT 作者:
public void changeLocaleAndReload(String locale){
    saveCurrentProject();
       Alert alert = new Alert(AlertType.CONFIRMATION);
       alert.setTitle("Confirmation Dialog");
       alert.setHeaderText("This will take effect after reboot");
       alert.setContentText("Are you ok with this?");

       Optional<ButtonType> result = alert.showAndWait();
       if (result.get() == ButtonType.OK){
           // ... user chose OK
        try {
            Properties props = new Properties();
            props.setProperty("locale", locale);
            File f = new File(getClass().getResource("../bundles/Current.properties").getFile());
            OutputStream out = new FileOutputStream( f );
            props.store(out, "This is an optional header comment string");

            start(primaryStage);
        }
        catch (Exception e ) {
            e.printStackTrace();
        }
       } else {
           // ... user chose CANCEL or closed the dialog
       }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号