diff --git a/schach/src/main/java/de/hs_mannheim/informatik/chess/gui/Gui.java b/schach/src/main/java/de/hs_mannheim/informatik/chess/gui/Gui.java index fe40b18..7179ca0 100644 --- a/schach/src/main/java/de/hs_mannheim/informatik/chess/gui/Gui.java +++ b/schach/src/main/java/de/hs_mannheim/informatik/chess/gui/Gui.java @@ -26,14 +26,40 @@ public class Gui { JFrame frame = new JFrame(); frame.setSize(1600, 1000); frame.setLocationRelativeTo(null); - frame.add(statsPanel()); - frame.add(chessPanel(boardPanel())); + frame.add(mainPanel()); frame.setDefaultCloseOperation(2); frame.setVisible(true); return frame; } + public JPanel mainPanel() { + JPanel mainPanel = new JPanel(new GridBagLayout()); + GridBagConstraints gbc = new GridBagConstraints(); + mainPanel.setBackground(new Color(0xe0e1dd)); + // Links (Schach) + gbc.gridx = 0; + gbc.gridy = 0; + gbc.weightx = 0.6; + gbc.weighty = 1.0; + gbc.insets = new Insets(5, 5, 5, 0); + //oben, links, unten, rechts + gbc.fill = GridBagConstraints.BOTH; + mainPanel.add(chessPanel(boardPanel()),gbc); + + // Rechts (Stats) + gbc.gridx = 1; + gbc.gridy = 0; + gbc.weightx = 0.4; + gbc.weighty = 1.0; + gbc.insets = new Insets(5, 0, 5, 5); + //oben, links, unten, rechts + gbc.fill = GridBagConstraints.BOTH; + mainPanel.add(statsPanel(), gbc); + + return mainPanel; + } + public JPanel boardPanel() { JPanel boardPanel = new JPanel(new GridLayout(8, 8)); boardPanel.setPreferredSize(new Dimension(800, 800));