Added JScrollPane to statsPanel for statistics

Quicksave
Justin 2025-06-20 01:53:30 +02:00
parent 28496459cf
commit d1d85ed428
1 changed files with 17 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package de.hs_mannheim.informatik.chess.view;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
@ -7,12 +8,15 @@ import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.util.List;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import de.hs_mannheim.informatik.chess.model.BoardDTO;
@ -24,6 +28,9 @@ public class GameGui {
private JButton flipBoardButton;
private boolean isFlipped = false;
private JPanel moveListPanel;
private JScrollPane moveListScroll;
public GameGui(){
mainFrame();
}
@ -126,8 +133,15 @@ public class GameGui {
}
public JPanel statsPanel() {
JPanel statsPanel = new JPanel();
JPanel statsPanel = new JPanel(new BorderLayout());
statsPanel.setBackground(new Color(0x0d1b2a));
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);
return statsPanel;
}