Reworked statsPanel and added new Buttons in GameGui

Quicksave
Justin 2025-06-20 03:09:17 +02:00
parent 543caeb366
commit 6374c206de
1 changed files with 27 additions and 1 deletions

View File

@ -152,13 +152,39 @@ public class GameGui {
public JPanel statsPanel() {
JPanel statsPanel = new JPanel(new BorderLayout());
statsPanel.setBackground(new Color(0x0d1b2a));
// Move-Liste (scrollbar, wie gehabt)
moveListPanel = new JPanel();
moveListPanel.setLayout(new BoxLayout(moveListPanel, BoxLayout.Y_AXIS));
moveListPanel.setBackground(new Color(0x0d1b2a));
moveListScroll = new JScrollPane(moveListPanel);
moveListScroll.setPreferredSize(new Dimension(250, 800));
statsPanel.add(moveListScroll, BorderLayout.CENTER);
// Button-Leiste
JPanel buttonPanel = new JPanel();
buttonPanel.setBackground(new Color(0x0d1b2a));
// Grid oder Flow je nach Geschmack
buttonPanel.setLayout(new GridLayout(1, 4, 10, 0));
JButton btnFirst = new JButton("|<");
JButton btnPrev = new JButton("<");
JButton btnNext = new JButton(">");
JButton btnLast = new JButton(">|");
// Style (optional)
btnFirst.setBackground(new Color(0x212529)); btnFirst.setForeground(Color.WHITE);
btnPrev.setBackground(new Color(0x212529)); btnPrev.setForeground(Color.WHITE);
btnNext.setBackground(new Color(0x212529)); btnNext.setForeground(Color.WHITE);
btnLast.setBackground(new Color(0x212529)); btnLast.setForeground(Color.WHITE);
// Hinzufügen
buttonPanel.add(btnFirst);
buttonPanel.add(btnPrev);
buttonPanel.add(btnNext);
buttonPanel.add(btnLast);
// Unten ins BorderLayout
statsPanel.add(buttonPanel, BorderLayout.SOUTH);
return statsPanel;
}