首页 > 其他 > 详细

保存到properties

时间:2017-04-17 00:27:30      阅读:312      评论:0      收藏:0      [点我收藏+]
@FXML
private void savaconfig(ActionEvent event) {
try {
Properties prop = new Properties();
FileWriter fw = new FileWriter("conf" + File.separator + "config.properties");
BufferedWriter br = new BufferedWriter(fw);

String sqlmapPath = this.id_textFeild.getText();

prop.setProperty("SqlmapPath", sqlmapPath);

prop.store(br, "配置文件");

br.close();
new Alert(Alert.AlertType.NONE, "已保存到配置文件config.properties", new ButtonType[] { ButtonType.CLOSE }).show();
}
catch (Exception e) {
new Alert(Alert.AlertType.NONE, "未找到配置文件config.properties", new ButtonType[] { ButtonType.CLOSE }).show();
e.printStackTrace();
}
}

保存到properties

原文:http://www.cnblogs.com/SEC-fsq/p/6720437.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!