From 04614444552a0871c2ca6aeb499b57ffe1074841 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Sun, 28 Jul 2019 09:43:53 +0200 Subject: [PATCH] Fixed letter alignment below the board --- src/dev/kske/chess/ui/MainWindow.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dev/kske/chess/ui/MainWindow.java b/src/dev/kske/chess/ui/MainWindow.java index 45d7872..c6aaae6 100644 --- a/src/dev/kske/chess/ui/MainWindow.java +++ b/src/dev/kske/chess/ui/MainWindow.java @@ -82,8 +82,11 @@ public class MainWindow { mframe.getContentPane().add(toolPanel, BorderLayout.NORTH); JPanel letterPanel = new JPanel(new GridLayout(1, 8)); - for (int i = 0; i < 8; i++) - letterPanel.add(new JLabel(String.valueOf((char) (65 + i)))); + for (int i = 0; i < 8; i++) { + JLabel letterLabel = new JLabel(String.valueOf((char) (65 + i))); + letterLabel.setHorizontalAlignment(JLabel.CENTER); + letterPanel.add(letterLabel); + } mframe.add(letterPanel, BorderLayout.SOUTH); JPanel numberPanel = new JPanel(new GridLayout(8, 1));