Results 1 to 2 of 2
- 06-07-2011, 10:35 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 3
- Rep Power
- 0
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?
PHP 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()); } }
-
Files don't directly have icons, but the operating system can have icons associated with a file type. You would need to do this association through your OS, and possibly not via Java.
Similar Threads
-
Netbeans6.8 .jar file icon change
By avixt in forum AWT / SwingReplies: 3Last Post: 04-08-2011, 09:34 PM -
Icon on Jar file
By justbeller in forum AWT / SwingReplies: 4Last Post: 03-18-2011, 08:04 PM -
How to set Icon on jar file
By justbeller in forum AWT / SwingReplies: 6Last Post: 01-22-2011, 10:21 AM -
Change the icon of file in java
By smn in forum SWT / JFaceReplies: 18Last Post: 10-06-2010, 04:55 PM -
How to show or open a file download or file save dialog box
By java_bond in forum New To JavaReplies: 0Last Post: 03-05-2010, 04:21 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks