Amélioration des récompenses

This commit is contained in:
2024-11-24 14:32:29 +01:00
parent d73ccf1f1c
commit 1eb2e67e90
2 changed files with 7 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ public class Options {
public static boolean AUTO_FOCUS = true; public static boolean AUTO_FOCUS = true;
public static final int MAX_TILE_NUMBER = 50; public static final int MAX_TILE_NUMBER = 2;
public static boolean FULL_SCREEN = false; public static boolean FULL_SCREEN = false;

View File

@@ -11,6 +11,7 @@ public class RewardsPanel extends JPanel {
private JTextField usernameField; private JTextField usernameField;
private JPanel rewardsDisplayPanel; private JPanel rewardsDisplayPanel;
private JScrollPane scrollPane;
public RewardsPanel() { public RewardsPanel() {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
@@ -35,8 +36,8 @@ public class RewardsPanel extends JPanel {
// Panel pour afficher les récompenses // Panel pour afficher les récompenses
rewardsDisplayPanel = new JPanel(new GridLayout(0, 3, 10, 10)); rewardsDisplayPanel = new JPanel(new GridLayout(0, 3, 10, 10));
JScrollPane scrollPane = new JScrollPane(rewardsDisplayPanel); this.scrollPane = new JScrollPane(rewardsDisplayPanel); // Taille minimale pour éviter la réduction
mainPanel.add(scrollPane, createGridBagConstraints(0, 1, 1)); mainPanel.add(this.scrollPane, createGridBagConstraints(0, 1, 1));
// Action du bouton pour afficher les récompenses // Action du bouton pour afficher les récompenses
JButton fetchButton = new JButton("Afficher les récompenses de l'utilisateur"); JButton fetchButton = new JButton("Afficher les récompenses de l'utilisateur");
@@ -126,6 +127,9 @@ public class RewardsPanel extends JPanel {
noRewardsLabel.setForeground(Color.RED); noRewardsLabel.setForeground(Color.RED);
rewardsDisplayPanel.add(noRewardsLabel); rewardsDisplayPanel.add(noRewardsLabel);
} else { } else {
this.scrollPane.setPreferredSize(new Dimension(600, 300)); // Ajustez la taille comme nécessaire
this.scrollPane.setMinimumSize(new Dimension(600, 300));
// Otherwise, display the rewards // Otherwise, display the rewards
rewardsDisplayPanel.setLayout(new GridLayout(0, 3, 10, 10)); rewardsDisplayPanel.setLayout(new GridLayout(0, 3, 10, 10));