请问怎么修改ResourceBundle里面的属性呢? 谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 扩展ResourceBundle类->重写即可 String url = "I want to write this to properties"; try { String strUrlPath = "com/iijt/ticket/client/properties/URL.properties"; InputStream fis = new FileInputStream(strUrlPath); FileOutputStream fos = new FileOutputStream(strUrlPath); Properties prop = new Properties(); prop.load(fis); prop.put("url", url); prop.store(fos, ""); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally{ fos.close(); fis.close(); prop.clear(); } properties file is changed intourl=I want to write this to properties To strUrlPath,you can use absolute path or relatively path , on the basis of your project. java急急-模拟栈的解构 关于Swing实现国际化 问个低级又简单的问题? 死定了!!!!!!在线等候你的佳音 着急,运行 jar文件时控制台的输出能看见么? 连接SQLServer2000的问题 请教一个问题 聊天账号的自动生成问题 关于Swing的一个非常基础的问题 关于applet和socket(二) 求大神指教为什么用UDP写的客户端接收不到数据报 键盘事件问题,急急急,在线等!!!!! 构造url对象的参数如何写
try {
String strUrlPath = "com/iijt/ticket/client/properties/URL.properties";
InputStream fis = new FileInputStream(strUrlPath);
FileOutputStream fos = new FileOutputStream(strUrlPath);
Properties prop = new Properties();
prop.load(fis);
prop.put("url", url);
prop.store(fos, "");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally{
fos.close();
fis.close();
prop.clear();
}
url=I want to write this to properties