bouton editer
This commit is contained in:
parent
e0a7be9484
commit
4c0bdd73e7
Binary file not shown.
@ -25,16 +25,18 @@ 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 (grid_values[i][j] == 0){
|
||||||
case_editable[i][j] = new JTextField("", 1);
|
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].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));
|
||||||
case_editable[i][j].setHorizontalAlignment(JTextField.CENTER);
|
case_editable[i][j].setHorizontalAlignment(JTextField.CENTER);
|
||||||
fenetre.add(case_editable[i][j]);
|
fenetre.add(case_editable[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}else{
|
||||||
}
|
|
||||||
|
|
||||||
/*affichage de la grille*/
|
/*affichage de la grille*/
|
||||||
JTextField[][] case_modifiable = null;
|
JTextField[][] case_modifiable = null;
|
||||||
@ -59,6 +61,7 @@ public class grille extends JComponent{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*affichage fenetre*/
|
/*affichage fenetre*/
|
||||||
fenetre.setVisible(true);
|
fenetre.setVisible(true);
|
||||||
|
|
||||||
|
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.
@ -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() {
|
lancer.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e2) {
|
public void actionPerformed(ActionEvent e2) {
|
||||||
if(cheminFichier != null){
|
if(cheminFichier != null){
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user