diff --git a/Sudoku/grille.class b/Sudoku/grille.class deleted file mode 100644 index 7e3614b..0000000 Binary files a/Sudoku/grille.class and /dev/null differ diff --git a/Sudoku/grille.java b/Sudoku/grille.java index 7d58463..06ec7e5 100644 --- a/Sudoku/grille.java +++ b/Sudoku/grille.java @@ -25,44 +25,47 @@ public class grille extends JComponent{ case_editable = new JTextField[9][9]; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { - if ((grid_values[i][j]) == 0) { - case_editable[i][j] = new JTextField("", 1); - case_editable[i][j].setBorder(new LineBorder(Color.BLACK, 5)); - case_editable[i][j].setFont(new Font("Arial", Font.PLAIN, 30)); - case_editable[i][j].setHorizontalAlignment(JTextField.CENTER); - fenetre.add(case_editable[i][j]); - } - } + if (grid_values[i][j] == 0){ + case_editable[i][j] = new JTextField("", 1); + }else{ + case_editable[i][j] = new JTextField(String.valueOf(grid_values[i][j]), 1); + } + case_editable[i][j].setBorder(new LineBorder(Color.BLACK, 5)); + case_editable[i][j].setFont(new Font("Arial", Font.PLAIN, 30)); + case_editable[i][j].setHorizontalAlignment(JTextField.CENTER); + fenetre.add(case_editable[i][j]); + } } + }else{ + + /*affichage de la grille*/ + JTextField[][] case_modifiable = null; + JLabel[][] case_depart = null; + case_depart = new JLabel[9][9]; + case_modifiable = new JTextField[9][9]; + + for (int i = 0; i < 9; i++) { + for (int j = 0; j < 9; j++) { + if ((grid_values[i][j]) == 0) { + case_modifiable[i][j] = new JTextField("", 1); + case_modifiable[i][j].setBorder(new LineBorder(Color.BLACK, 5)); + case_modifiable[i][j].setFont(new Font("Arial", Font.PLAIN, 30)); + case_modifiable[i][j].setHorizontalAlignment(JTextField.CENTER); + fenetre.add(case_modifiable[i][j]); + } else { + case_depart[i][j] = new JLabel(String.valueOf(grid_values[i][j])); + case_depart[i][j].setBorder(new LineBorder(Color.BLACK, 5)); + case_depart[i][j].setFont(new Font("Arial", Font.PLAIN, 30)); + case_depart[i][j].setHorizontalAlignment(JTextField.CENTER); + fenetre.add(case_depart[i][j]); + } + } + } } - - /*affichage de la grille*/ - JTextField[][] case_modifiable = null; - JLabel[][] case_depart = null; - case_depart = new JLabel[9][9]; - case_modifiable = new JTextField[9][9]; - - for (int i = 0; i < 9; i++) { - for (int j = 0; j < 9; j++) { - if ((grid_values[i][j]) == 0) { - case_modifiable[i][j] = new JTextField("", 1); - case_modifiable[i][j].setBorder(new LineBorder(Color.BLACK, 5)); - case_modifiable[i][j].setFont(new Font("Arial", Font.PLAIN, 30)); - case_modifiable[i][j].setHorizontalAlignment(JTextField.CENTER); - fenetre.add(case_modifiable[i][j]); - } else { - case_depart[i][j] = new JLabel(String.valueOf(grid_values[i][j])); - case_depart[i][j].setBorder(new LineBorder(Color.BLACK, 5)); - case_depart[i][j].setFont(new Font("Arial", Font.PLAIN, 30)); - case_depart[i][j].setHorizontalAlignment(JTextField.CENTER); - fenetre.add(case_depart[i][j]); - } - } - } /*affichage fenetre*/ fenetre.setVisible(true); - /*System.out.println(grid[0][0].getText());*/ + /*System.out.println(grid[0][0].getText());*/ } diff --git a/Sudoku/main.class b/Sudoku/main.class deleted file mode 100644 index 8695e7b..0000000 Binary files a/Sudoku/main.class and /dev/null differ diff --git a/Sudoku/menu$1.class b/Sudoku/menu$1.class deleted file mode 100644 index 905cc0f..0000000 Binary files a/Sudoku/menu$1.class and /dev/null differ diff --git a/Sudoku/menu$2.class b/Sudoku/menu$2.class deleted file mode 100644 index 7490869..0000000 Binary files a/Sudoku/menu$2.class and /dev/null differ diff --git a/Sudoku/menu$3.class b/Sudoku/menu$3.class deleted file mode 100644 index b670317..0000000 Binary files a/Sudoku/menu$3.class and /dev/null differ diff --git a/Sudoku/menu$4.class b/Sudoku/menu$4.class deleted file mode 100644 index 64807df..0000000 Binary files a/Sudoku/menu$4.class and /dev/null differ diff --git a/Sudoku/menu$5.class b/Sudoku/menu$5.class deleted file mode 100644 index ff1cefd..0000000 Binary files a/Sudoku/menu$5.class and /dev/null differ diff --git a/Sudoku/menu.class b/Sudoku/menu.class deleted file mode 100644 index 493dac1..0000000 Binary files a/Sudoku/menu.class and /dev/null differ diff --git a/Sudoku/menu.java b/Sudoku/menu.java index 053df5f..a3c3e9d 100644 --- a/Sudoku/menu.java +++ b/Sudoku/menu.java @@ -82,6 +82,13 @@ public class menu { } }); + editer.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e4){ + fenetre.dispose(); + grille.AfficherGrille(grille.ChargerGrille(cheminFichier), true); + } + }); + lancer.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e2) { if(cheminFichier != null){ diff --git a/Sudoku/resolveurGrille.class b/Sudoku/resolveurGrille.class deleted file mode 100644 index cdf3903..0000000 Binary files a/Sudoku/resolveurGrille.class and /dev/null differ