Hi,
I have a method in my application called "export" which exports the JPanel content 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.
The code is on a different computer, so dont worry about syntax errors, I just write the important bits:
JFileChooser jfc = new JFileChooser();
int answer = jfc.showSaveDialog(this);
if(answer==jfc.APPROVE_OPTION) {
try {
File file = jfc.getSelectedFile();
ImageIO.write(Graph, "png", file); //Graph is what that needs to be exported
} catch () {}
any help, highly appreciated, thanks