This commit is contained in:
AlgaLaptop
2026-01-02 20:52:44 +01:00
parent 2e0f44d28d
commit bceb70c052
31 changed files with 197 additions and 341 deletions
@@ -45,6 +45,8 @@ public class ConverterController {
this.fen = fen;
this.outputPath = out;
this.inputPath = in;
System.out.println(this.inputPath+" ==> "+this.outputPath);
}
@@ -166,7 +168,9 @@ public class ConverterController {
chooser.setDialogTitle("Enregistrer le fichier .pif");
if (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
saveAsPIF(chooser.getSelectedFile().getAbsolutePath());
//saveAsPIF(chooser.getSelectedFile().getAbsolutePath());
// On lance la sauvegarde lourde dans un thread séparé
new Thread(() -> saveAsPIF(chooser.getSelectedFile().getAbsolutePath())).start();
System.out.println("Fichier sauvegardé : " + chooser.getSelectedFile().getAbsolutePath());
JOptionPane.showMessageDialog(null, "Fichier sauvegardé avec succès : " + chooser.getSelectedFile().getName());
}
@@ -175,7 +179,6 @@ public class ConverterController {
} catch (Exception ex) {
System.out.println("Erreur lors de la sauvegarde : " + ex.getMessage());
ex.printStackTrace();
}
}
@@ -193,6 +196,7 @@ public class ConverterController {
this.loadImage(choosser.getSelectedFile());
}else {
System.err.println("Aucune image choisie. Arrêt du programme.");
System.exit(1);
return;
}
}