String value =“”
try {
FileInputStream fis=new FileInputStream(“新建文本文档.txt”);/这个文件我是放在根目录的/
Properties pro=new Properties();
pro.load(fis)
fis.close();
value =pro.getProperty (str);/str是之前定义的字符串/
JOptiinPane.showMessageDialog (null,value);/这个框输不出键值对的值,也就是value/
}
Catch (IOException e1){
e1.printStachTrace();}
FileInputStream fis=new FileInputStream(“新建文本文档.txt”);
路径改为绝对路径。
是发生了什么问题。
还是建议Debug调试看哪里出现了问题。
我这里没有你的环境。
恢复不了代码运行时是什么结果。