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 final int MAX_TILE_NUMBER = 50;
public static final int MAX_TILE_NUMBER = 2;
public static boolean FULL_SCREEN = false;

View File

@@ -11,6 +11,7 @@ public class RewardsPanel extends JPanel {
private JTextField usernameField;
private JPanel rewardsDisplayPanel;
private JScrollPane scrollPane;
public RewardsPanel() {
setLayout(new BorderLayout());
@@ -35,8 +36,8 @@ public class RewardsPanel extends JPanel {
// Panel pour afficher les récompenses
rewardsDisplayPanel = new JPanel(new GridLayout(0, 3, 10, 10));
JScrollPane scrollPane = new JScrollPane(rewardsDisplayPanel);
mainPanel.add(scrollPane, createGridBagConstraints(0, 1, 1));
this.scrollPane = new JScrollPane(rewardsDisplayPanel); // Taille minimale pour éviter la réduction
mainPanel.add(this.scrollPane, createGridBagConstraints(0, 1, 1));
// Action du bouton pour afficher les récompenses
JButton fetchButton = new JButton("Afficher les récompenses de l'utilisateur");
@@ -126,6 +127,9 @@ public class RewardsPanel extends JPanel {
noRewardsLabel.setForeground(Color.RED);
rewardsDisplayPanel.add(noRewardsLabel);
} 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
rewardsDisplayPanel.setLayout(new GridLayout(0, 3, 10, 10));