This commit is contained in:
raban
2024-05-01 21:40:26 +02:00
parent e1e3ebf602
commit 41e673939b
21 changed files with 47 additions and 1 deletions
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
import javax.swing.*;
import java.awt.*;
import java.io.*;
import javax.swing.filechooser.FileNameExtensionFilter;
public class Lecteur{
public static void lecture(String name, int [][] g) {
int valeur[] = new int[9];
int valeur_en_fin[][]= new int[9][9];
int valeur_actuelle=0;
try{
FileInputStream fichier = new FileInputStream(name);
DataInputStream flux = new DataInputStream(fichier);
try{
for(int i=0; i<9; i++){
valeur[i]=flux.readInt();
System.out.print(valeur[i]);
}
flux.close();
}catch(IOException e){
System.out.println("Lecture fichier impossible");
}
}catch(FileNotFoundException e){
System.out.println("Fichier non trouvé");
}
for(int i=0; i<9; i++){
for(int j=8; j>=0; j--){
valeur_actuelle=valeur[i];
valeur_actuelle=valeur_actuelle%10;
valeur[i]=(valeur[i]-valeur_actuelle)/10;
valeur_en_fin[i][j]=valeur_actuelle;
System.out.print(valeur_actuelle);
g[i][j] = valeur_actuelle;
}
valeur_actuelle=0;
}
}
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -1
View File
@@ -55,7 +55,8 @@ public class MainCreation {
JPanel panneau = new JPanel(); JPanel panneau = new JPanel();
int valeur_de_retour = fichier.showOpenDialog(panneau); int valeur_de_retour = fichier.showOpenDialog(panneau);
if(valeur_de_retour == JFileChooser.APPROVE_OPTION) { if(valeur_de_retour == JFileChooser.APPROVE_OPTION) {
//Grilles.grilleExiste(fichier.getSelectedFile().getName()); Lecteur.lecture(fichier.getSelectedFile().getName(), grille);
fenetreModification(grille);
} }
} }
}); });
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.