How to save file using JFileChooser??

Posted by Lokesh Kumar on Stack Overflow See other posts from Stack Overflow or by Lokesh Kumar
Published on 2010-03-27T21:40:03Z Indexed on 2010/03/27 21:43 UTC
Read the original article Hit count: 454

Hi,

I have a method in my application called "Save as" which Saves the image of my application on computer my into a file. I used the JFileChooser to let the users choose their desired location for saving the file. The problem is unless user explicitly types in the file format, it saves the file with no extension. How can I have formats like jpg, png in the File Type drop down menu.

and, how can i get extension from the File Type drop menu for saving my image file.

 ImageIO.write(image,extension,file);

© Stack Overflow or respective owner

Related posts about jfilechooser

Related posts about java