Lecteur
This commit is contained in:
parent
022ac4299c
commit
0d812b9b4c
Binary file not shown.
Binary file not shown.
BIN
Grilles.class
BIN
Grilles.class
Binary file not shown.
Binary file not shown.
BIN
Lecteur.class
BIN
Lecteur.class
Binary file not shown.
@ -4,7 +4,7 @@ import java.io.*;
|
|||||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||||
|
|
||||||
public class Lecteur{
|
public class Lecteur{
|
||||||
public static void lecture(String name, int [][] g) {
|
public static void lecture(File name, int [][] g) {
|
||||||
|
|
||||||
int valeur[] = new int[9];
|
int valeur[] = new int[9];
|
||||||
int valeur_en_fin[][]= new int[9][9];
|
int valeur_en_fin[][]= new int[9][9];
|
||||||
@ -41,5 +41,6 @@ public class Lecteur{
|
|||||||
}
|
}
|
||||||
valeur_actuelle=0;
|
valeur_actuelle=0;
|
||||||
}
|
}
|
||||||
|
System.out.print("Fichier enregistrer");
|
||||||
}
|
}
|
||||||
}
|
}
|
BIN
Main$1.class
BIN
Main$1.class
Binary file not shown.
BIN
Main$2.class
BIN
Main$2.class
Binary file not shown.
BIN
Main$3.class
BIN
Main$3.class
Binary file not shown.
BIN
Main.class
BIN
Main.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -45,17 +45,17 @@ public class MainCreation {
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
selF.dispose();
|
selF.dispose();
|
||||||
JFileChooser fichier = new JFileChooser();
|
JFileChooser fileChooser = new JFileChooser();
|
||||||
|
|
||||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("File grille","gri");
|
FileNameExtensionFilter filter = new FileNameExtensionFilter("File grille","gri");
|
||||||
fichier.setFileFilter(filter);
|
fileChooser.setFileFilter(filter);
|
||||||
|
|
||||||
File workingDirectory = new File(System.getProperty("user.dir"));
|
File workingDirectory = new File(System.getProperty("user.dir"));
|
||||||
fichier.setCurrentDirectory(workingDirectory);
|
fileChooser.setCurrentDirectory(workingDirectory);
|
||||||
JPanel panneau = new JPanel();
|
JPanel panneau = new JPanel();
|
||||||
int valeur_de_retour = fichier.showOpenDialog(panneau);
|
int valeur_de_retour = fileChooser.showOpenDialog(panneau);
|
||||||
if(valeur_de_retour == JFileChooser.APPROVE_OPTION) {
|
if(valeur_de_retour == JFileChooser.APPROVE_OPTION) {
|
||||||
Lecteur.lecture(fichier.getSelectedFile().getName(), grille);
|
Lecteur.lecture(fileChooser.getSelectedFile(), grille);
|
||||||
fenetreModification(grille);
|
fenetreModification(grille);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ public class MainCreation {
|
|||||||
JPanel panneau = new JPanel();
|
JPanel panneau = new JPanel();
|
||||||
int valeur_de_retour = fileChooser.showOpenDialog(panneau);
|
int valeur_de_retour = fileChooser.showOpenDialog(panneau);
|
||||||
if(valeur_de_retour == JFileChooser.APPROVE_OPTION) {
|
if(valeur_de_retour == JFileChooser.APPROVE_OPTION) {
|
||||||
Register.sauvegarde(fileChooser.getSelectedFile().getName(), grille);
|
Register.sauvegarde(fileChooser.getSelectedFile(), grille);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Binary file not shown.
BIN
Register.class
BIN
Register.class
Binary file not shown.
@ -4,7 +4,7 @@ import java.io.*;
|
|||||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||||
|
|
||||||
public class Register{
|
public class Register{
|
||||||
public static void sauvegarde(String name, int [][] g){
|
public static void sauvegarde(File name, int [][] g){
|
||||||
int val[] = new int[9];
|
int val[] = new int[9];
|
||||||
|
|
||||||
int actuVal=0;
|
int actuVal=0;
|
||||||
@ -33,5 +33,6 @@ public class Register{
|
|||||||
}catch(FileNotFoundException e){
|
}catch(FileNotFoundException e){
|
||||||
System.out.println("Fichier non trouvé");
|
System.out.println("Fichier non trouvé");
|
||||||
}
|
}
|
||||||
|
System.out.print("Fichier enregistrer");
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
BIN
Resolveur.class
BIN
Resolveur.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user