Personal project with Java Swing. This project was something I had developed to test my understanding of Object Oriented Programming principles. I have revisited the project and added graphics.
The project consists of 6 java files and 1 additional file for the pngs needed for graphics.
-
Cell.java outlines the individuals cells that can be clicked and opened.
-
Minefield.java outlines the grid of Cell objects which the game is played on. The main component is a 2D array of Cells.
-
Board.java extends JPanel and adds the graphic and user interaction components of the program. This class deals with mouse clicks and updates the graphics when necessary.
4 & 5. Menu.java and Configuration.java are only used in the initial set up of the game. Run Menu.java to play the game
-
MouseReader.java deals with MouseEvents.
-
img.zip contains .png files that are used in the code.
You can run the code simply by unzipping img and running the main method in Menu.java.