diff --git a/src/main/java/Minesweeper/Cell.java b/src/main/java/Minesweeper/Cell.java index 36946f8..a455e88 100644 --- a/src/main/java/Minesweeper/Cell.java +++ b/src/main/java/Minesweeper/Cell.java @@ -13,4 +13,12 @@ public class Cell extends JButton { public Cell(CellType _type) { type = _type; } + + public void update() { + if(type == CellType.Number) { + setText(String.valueOf(value)); + } else { + + } + } } diff --git a/src/main/java/Minesweeper/MinesweeperGame.java b/src/main/java/Minesweeper/MinesweeperGame.java index fde06cd..231c674 100644 --- a/src/main/java/Minesweeper/MinesweeperGame.java +++ b/src/main/java/Minesweeper/MinesweeperGame.java @@ -18,7 +18,7 @@ public class MinesweeperGame extends JPanel { public static void main(String[] args) { JFrame f = new JFrame(); - MinesweeperGame ttt = new MinesweeperGame(3, 0); + MinesweeperGame ttt = new MinesweeperGame(8, 10); f.add(ttt); f.setSize(WIDTH, HEIGTH); diff --git a/src/main/java/Minesweeper/Playfield.java b/src/main/java/Minesweeper/Playfield.java index a56dbc6..9f52d84 100644 --- a/src/main/java/Minesweeper/Playfield.java +++ b/src/main/java/Minesweeper/Playfield.java @@ -99,6 +99,8 @@ public class Playfield { cells[row][column].value++; } } + + cells[row][column].update(); } }