From 9ad9193244d045a470ecd64b60d4b35da2301432 Mon Sep 17 00:00:00 2001 From: ROGER Date: Tue, 13 May 2025 14:36:56 +0200 Subject: [PATCH] =?UTF-8?q?ajout=20rendu=20pi=C3=A8ce=20suivante?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/org/Views/VueControle.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/Views/VueControle.java b/app/src/main/java/org/Views/VueControle.java index 9bbadde..0a74b7c 100644 --- a/app/src/main/java/org/Views/VueControle.java +++ b/app/src/main/java/org/Views/VueControle.java @@ -25,9 +25,10 @@ public class VueControle extends JPanel { nextPiecePanel.setMaximumSize(new Dimension(100, 100)); nextPiecePanel.setBackground(Color.LIGHT_GRAY); nextPiecePanel.setAlignmentX(Component.CENTER_ALIGNMENT); + initierNextPiecePanel(); //PAUSE BUTTON - pauseButton = new JButton("Pause"); + pauseButton = new JButton("Pause / Play"); pauseButton.setAlignmentX(Component.CENTER_ALIGNMENT); add(Box.createVerticalStrut(20)); // Add some space at the top @@ -51,4 +52,17 @@ public class VueControle extends JPanel { public JPanel getNextPiecePanel() { return nextPiecePanel; } + + private void initierNextPiecePanel() { + nextPiecePanel.removeAll(); + nextPiecePanel.setLayout(new GridLayout(4, 4)); + for (int i = 0; i < 16; i++) { + JPanel caseG = new JPanel(); + caseG.setBorder(BorderFactory.createLineBorder(Color.BLACK)); + caseG.setBackground(Color.WHITE); + nextPiecePanel.add(caseG); + } + nextPiecePanel.revalidate(); + nextPiecePanel.repaint(); + } } \ No newline at end of file