ajout rendu pièce suivante

This commit is contained in:
ROGER
2025-05-13 14:36:56 +02:00
parent f9e3f1d2bb
commit 9ad9193244

View File

@@ -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();
}
}