Fixed remaining mines counter not showing on startup
This commit is contained in:
parent
2ac192c230
commit
7ae28ce948
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user