salve ragazzi, vorrei sapere una cosa, devo fare in modo che un file presente nel pc (già preimpostato) debba essere salvato mediante una jfilechooser, ma non so come fare, vi mando il codice da me provato
codice:
JFileChooser chooser = new JFileChooser ();
   chooser.removeChoosableFileFilter (chooser.getAcceptAllFileFilter ());
   chooser.addChoosableFileFilter (new FileNameExtensionFilter ("Documento Acrobat Reader", "pdf"));
  int returnVal = chooser.showSaveDialog(jPanel);
  String destinazione;
  if(returnVal==JFileChooser.APPROVE_OPTION){
  File fFile = chooser.getSelectedFile ();
          if (fFile.exists ()) {
              int response = JOptionPane.showConfirmDialog (jInserimentoprog,
                "Sovrascrivere il file esistente?","Conferma sovrascrittura",
                 JOptionPane.OK_CANCEL_OPTION,
                 JOptionPane.QUESTION_MESSAGE);
              if (response == JOptionPane.CANCEL_OPTION) {         
 destinazione=null;
              }else{
             
  destinazione=fFile.getPath();
              }
              }else{
             destinazione =fFile.getPath() + ".pdf";
              
              }
      }else{
      destinazione=null;
      }