From 1eb2e67e90f78633eeeaebc0b55f10e2ca2aa249 Mon Sep 17 00:00:00 2001 From: Moncef STITI Date: Sun, 24 Nov 2024 14:32:29 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20des=20r=C3=A9compenses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestV2/src/fr/monkhanny/dorfromantik/Options.java | 2 +- .../src/fr/monkhanny/dorfromantik/gui/RewardsPanel.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/TestV2/src/fr/monkhanny/dorfromantik/Options.java b/TestV2/src/fr/monkhanny/dorfromantik/Options.java index f98cbc4..fc25213 100644 --- a/TestV2/src/fr/monkhanny/dorfromantik/Options.java +++ b/TestV2/src/fr/monkhanny/dorfromantik/Options.java @@ -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; diff --git a/TestV2/src/fr/monkhanny/dorfromantik/gui/RewardsPanel.java b/TestV2/src/fr/monkhanny/dorfromantik/gui/RewardsPanel.java index 5b6177a..36342e4 100644 --- a/TestV2/src/fr/monkhanny/dorfromantik/gui/RewardsPanel.java +++ b/TestV2/src/fr/monkhanny/dorfromantik/gui/RewardsPanel.java @@ -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));