Fixed remaining mines counter not showing on startup

This commit is contained in:
Kai S. K. Engelbart 2019-04-07 16:54:24 +02:00
parent 2ac192c230
commit 7ae28ce948
2 changed files with 2 additions and 2 deletions

View File

@ -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();
}

View File

@ -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();