現在,我可以使用JFileChooser保存文件,但是如何將圖標添加到我保存的文件中?如何將圖標添加到我的保存文件?
fileChooser.addChoosableFileFilter(new CLVFilter());
int returnValue = fileChooser.showSaveDialog(frame);
if(returnValue == JFileChooser.APPROVE_OPTION){
try{
//filename consists of path
String filename = fileChooser.getSelectedFile().toString();
FileWriter fstream = new FileWriter(filename);
BufferedWriter out = new BufferedWriter(fstream);
out.write(SingleIntersection.this.getContentsOfObject());
out.close();
}catch (Exception excep){//Catch exception if any
System.err.println("Error: " + excep.getMessage());
}
}
你在說什麼? – SLaks 2011-06-07 20:41:40
@Slaks,他可能指的是操作系統中文件的顯示。 – 2011-06-07 20:44:43
所以我想我不能使用java來添加圖標到我保存的文件,好吧,謝謝你的幫助 – help 2011-06-07 21:23:38