fin création d'une grille vide
This commit is contained in:
parent
bb5488f3bb
commit
08e7104bcb
@ -25,10 +25,10 @@ public class grille extends JComponent{
|
|||||||
case_editable = new JTextField[9][9];
|
case_editable = new JTextField[9][9];
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
for (int j = 0; j < 9; j++) {
|
for (int j = 0; j < 9; j++) {
|
||||||
if (grid_values[i][j] == 0){
|
if (grille[i][j] == 0){
|
||||||
case_editable[i][j] = new JTextField("", 1);
|
case_editable[i][j] = new JTextField("", 1);
|
||||||
}else{
|
}else{
|
||||||
case_editable[i][j] = new JTextField(String.valueOf(grid_values[i][j]), 1);
|
case_editable[i][j] = new JTextField(String.valueOf(grille[i][j]), 1);
|
||||||
}
|
}
|
||||||
case_editable[i][j].setBorder(new LineBorder(Color.BLACK, 5));
|
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].setFont(new Font("Arial", Font.PLAIN, 30));
|
||||||
|
@ -85,9 +85,16 @@ public class menu {
|
|||||||
|
|
||||||
editer.addActionListener(new ActionListener(){
|
editer.addActionListener(new ActionListener(){
|
||||||
public void actionPerformed(ActionEvent e4){
|
public void actionPerformed(ActionEvent e4){
|
||||||
if (cheminFichier != null){
|
if (cheminFichier == null){
|
||||||
int[][] grille_vide = new int[9][9];
|
int[][] grille_vide = null;
|
||||||
Arrays.fill(grille_vide, 0);
|
grille_vide = new int[9][9];
|
||||||
|
|
||||||
|
for (int i = 0; i < 9; i++) {
|
||||||
|
for (int j = 0; j < 9 ; j++ ) {
|
||||||
|
grille_vide[i][j] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fenetre.dispose();
|
fenetre.dispose();
|
||||||
grille.AfficherGrille(grille_vide, true);
|
grille.AfficherGrille(grille_vide, true);
|
||||||
}else{
|
}else{
|
||||||
@ -121,7 +128,7 @@ public class menu {
|
|||||||
|
|
||||||
manuel.addActionListener(new ActionListener() {
|
manuel.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e1) {
|
||||||
ResolutionManuel = true;
|
ResolutionManuel = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user