views:

840

answers:

3

does anyone know how to save a file image with previously show a dialog to choose where the location is and input a name of the file?

thanks for your response, appreciate it

+2  A: 

You don't specify a technology, with swing you can use JFileChooserDialog, see here for more info.

JFileChooserDialog fcd = new JFileChooserDialog();
fcd.showSaveDialog(component);
Tom
A: 

thanks bro, but the next problem appears, i dont know how to save the image with input name and the jpg extension

i tried

try {
        BufferedImage bi = getMyImage(); // retrieve image
        File outputfile = new File(jFileChooser1.getSelectedFile().getName());
        ImageIO.write(bi, "jpg", outputfile);

but not working,

thanks

A: 

In what way does it not work? It will be hard to debug unless you specify the actual output.

Julson Lim