register
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2
-1
@@ -55,7 +55,8 @@ public class MainCreation {
|
||||
JPanel panneau = new JPanel();
|
||||
int valeur_de_retour = fichier.showOpenDialog(panneau);
|
||||
if(valeur_de_retour == JFileChooser.APPROVE_OPTION) {
|
||||
//Grilles.grilleExiste(fichier.getSelectedFile().getName());
|
||||
Lecteur.lecture(fichier.getSelectedFile().getName(), grille);
|
||||
fenetreModification(grille);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user