From 9c2de1f2f7ef7c6630a2bf9cfe10fde1dfdeb24b Mon Sep 17 00:00:00 2001 From: kfkama Date: Thu, 17 Feb 2022 19:44:48 +0100 Subject: [PATCH] Bugfix numbers not showen --- src/main/java/Minesweeper/Cell.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/Minesweeper/Cell.java b/src/main/java/Minesweeper/Cell.java index 4991e9e..f8535eb 100644 --- a/src/main/java/Minesweeper/Cell.java +++ b/src/main/java/Minesweeper/Cell.java @@ -91,7 +91,9 @@ public class Cell extends JButton { public void reveal() { if (type == CellType.Number) { - setText(String.valueOf(value)); + if(value > 0) { + setText(String.valueOf(value)); + } } else { setBackground(MINECOLOR); } @@ -104,6 +106,7 @@ public class Cell extends JButton { setBackground(FLOODEDCOLOR); setEnabled(false); + reveal(); playfield.cellFlooded(); if (value == 0) {