Maj
This commit is contained in:
@@ -8,20 +8,22 @@ public class LoadButton implements ActionListener {
|
|||||||
|
|
||||||
private int GRID_SIZE;
|
private int GRID_SIZE;
|
||||||
private JTextField[][] grid;
|
private JTextField[][] grid;
|
||||||
|
private int status;
|
||||||
private JFrame parent;
|
private JFrame parent;
|
||||||
|
|
||||||
public LoadButton( int GRID_SIZE, JTextField[][] grid) {
|
public LoadButton( int GRID_SIZE, JTextField[][] grid, int status) {
|
||||||
|
|
||||||
this.GRID_SIZE = GRID_SIZE;
|
this.GRID_SIZE = GRID_SIZE;
|
||||||
this.grid = grid;
|
this.grid = grid;
|
||||||
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (SudokuGridConcepteur.BOOL) {
|
if (status == 1) {
|
||||||
chargerFichier();
|
chargerFichier();
|
||||||
} else {
|
} else if(status == 2){
|
||||||
chargerFichierNonEditable();
|
chargerFichierNonEditable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,7 +85,10 @@ public class LoadButton implements ActionListener {
|
|||||||
// Rendre les champs de texte non éditables
|
// Rendre les champs de texte non éditables
|
||||||
if (cell != 0) {
|
if (cell != 0) {
|
||||||
grid[i][j].setEditable(false);
|
grid[i][j].setEditable(false);
|
||||||
|
grid[i][j].setEnabled(false);
|
||||||
grid[i][j].setBackground(Color.white);
|
grid[i][j].setBackground(Color.white);
|
||||||
|
UIManager.put("TextField.inactiveForeground", Color.BLACK);
|
||||||
|
SwingUtilities.updateComponentTreeUI(grid[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user