how would i add icon to my save file?
right now, i can save a file using JFileChooser, but how would i added an icon to the file that i saved?
Code:
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());
}
}