Adaptable Guessing Game(BattleField) Using Java Swing Technology With Source Code Attached

This game is very simple and developed by Java Swing Technology. You have to try to find all of the Vehicles BEFORE finding the Mines (in the case of the Sea Game) and Road Blocks (in the case of the Land based game).


– Road Block 

The last vehicle you found is Mine(in the case of the Sea Game) & Road Block (in the case of the Land based game) then you won the game otherwise you lose game.
Jar file of Game :-
Download Eclipse Project with code :-
Download NetBeans Project with code :-


This is the main screen of game. You can choose to play between land based and sea based game. Also you can se size of matrix (3×3,4×4,5×5) as per need.  Now Go on finding vehicles.
The last vehicle I found was mine that’s why I won the game. You can reset whole game and play again too.
In case of land based game, The last vehicle I found was tank that’s why I lost the game.
Here goes main logic of whole game.
On every button click, I am calling function takeaction. And it will create vehicle object and displays on button and if button is already clicked, no action will be taken.
And this code will check whether you have clicked last button and if yes then it will display result.

Leave a Reply

Your email address will not be published. Required fields are marked *