Grazie per la risposta,
questa è la mia classe salva.
Ciaocodice:public void actionPerformed(ActionEvent e) { JFileChooser fc = new JFileChooser(); int returnVal = fc.showSaveDialog(Grafica.this); if (returnVal == JFileChooser.APPROVE_OPTION) { try { File file = fc.getSelectedFile(); FileOutputStream ostream = new FileOutputStream(file); ObjectOutputStream p = new ObjectOutputStream(ostream); p.writeObject((Object) immagine); p.flush(); ostream.close(); } catch (IOException ex) { Logger.getLogger(Grafica.class.getName()).log(Level.SEVERE, null, ex); } } }

Rispondi quotando