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