Correction des bugs de verions entre Windows, Linux et macOS

This commit is contained in:
2024-04-29 14:34:45 +02:00
parent 62a90389ca
commit 0cc2067922
6 changed files with 29 additions and 7 deletions

View File

@@ -19,6 +19,17 @@ public class Button extends JButton {
setBackground(new Color(96, 175, 255));
}
/**
* Constructor
* @param text The text of the button
* @param color The background color of the button
*/
public Button (String text,Color color) {
super(text);
setFont(new Font("Arial", Font.BOLD, 15));
setBackground(color);
}
/**
* Constructor
* @param text The text of the button

View File

@@ -72,7 +72,7 @@ public class HomeView extends JPanel {
buttonPanel.setBackground(BACKGROUND_COLOR);
HomeButtonClickListener listenerButton = new HomeButtonClickListener(window);
for (String text : BUTTON_TEXTS) {
Button button = new Button(text, BUTTON_SIZE, BUTTON_FONT, BACKGROUND_COLOR);
Button button = new Button(text, BUTTON_SIZE, BUTTON_FONT, Color.white);
button.addActionListener(listenerButton);
buttonPanel.add(button);
}

View File

@@ -18,6 +18,17 @@ public class Button extends JButton {
setFont(new Font("Arial", Font.BOLD, 15));
setBackground(new Color(96, 175, 255));
}
/**
* Constructor
* @param text The text of the button
* @param color The background color of the button
*/
public Button (String text,Color color) {
super(text);
setFont(new Font("Arial", Font.BOLD, 15));
setBackground(color);
}
/**
* Constructor

View File

@@ -43,10 +43,10 @@ public class GSMenu {
this.buttonPanel.setBackground(new Color(54, 91, 109));
// Création des boutons
this.importerButton = new Button("Charger une grille");
this.jouerButton = new Button("Jouer");
this.importerButton = new Button("Charger une grille",Color.white);
this.jouerButton = new Button("Jouer",Color.white);
this.jouerButton.setEnabled(false); // Le bouton "Jouer" est désactivé par défaut
this.autoSolveButton = new Button("Résolution automatique");
this.autoSolveButton = new Button("Résolution automatique",Color.white);
this.autoSolveButton.setEnabled(false); // Le bouton "Résolution automatique" est désactivé par défaut
// Ajout des boutons au panneau de boutons

View File

@@ -72,7 +72,7 @@ public class HomeView extends JPanel {
buttonPanel.setBackground(BACKGROUND_COLOR);
HomeButtonClickListener listenerButton = new HomeButtonClickListener(window);
for (String text : BUTTON_TEXTS) {
Button button = new Button(text, BUTTON_SIZE, BUTTON_FONT, BACKGROUND_COLOR);
Button button = new Button(text, BUTTON_SIZE, BUTTON_FONT, Color.white);
button.addActionListener(listenerButton);
buttonPanel.add(button);
}