From 7ae28ce948e4a06840bd13b97d1695ffb5c41cee Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Sun, 7 Apr 2019 16:54:24 +0200 Subject: [PATCH] Fixed remaining mines counter not showing on startup --- src/dev/kske/minesweeper/Board.java | 1 - src/dev/kske/minesweeper/Minesweeper.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dev/kske/minesweeper/Board.java b/src/dev/kske/minesweeper/Board.java index 0bba057..d0f888a 100644 --- a/src/dev/kske/minesweeper/Board.java +++ b/src/dev/kske/minesweeper/Board.java @@ -90,7 +90,6 @@ public class Board extends JPanel { for (int j = 0; j < boardHeight; j++) board[i][j] = new Tile(); initMines(); - notifyFlaggedTilesEvent(new FlaggedTilesEvent(this, flaggedTiles)); repaint(); } diff --git a/src/dev/kske/minesweeper/Minesweeper.java b/src/dev/kske/minesweeper/Minesweeper.java index 9c2af9d..a1529ca 100644 --- a/src/dev/kske/minesweeper/Minesweeper.java +++ b/src/dev/kske/minesweeper/Minesweeper.java @@ -83,7 +83,7 @@ public class Minesweeper { mframe.getContentPane().add(headerPanel, BorderLayout.NORTH); headerPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); - JLabel lblRemainingMines = new JLabel("Remaining Mines:"); + JLabel lblRemainingMines = new JLabel("Remaining Mines: " + easyConfig.mines); lblRemainingMines.setHorizontalAlignment(SwingConstants.LEFT); headerPanel.add(lblRemainingMines); @@ -108,6 +108,7 @@ public class Minesweeper { }); JButton btnRestart = new JButton("Restart"); + btnRestart.setHorizontalAlignment(SwingConstants.RIGHT); headerPanel.add(btnRestart); btnRestart.addActionListener((evt) -> board.reset()); mframe.pack();