A Java Swing application that simulates a military defence system with three units (Tank, Helicopter, and Submarine) controlled by a central command center. The application demonstrates the Observer design pattern for communication between different military units.
- Command and Control System: Central command center for coordinating military units
- Multiple Defence Units: Tank, Helicopter, and Submarine units with unique capabilities
- Communication System: Message passing between units and command center
- Resource Management: Monitor and manage fuel, ammunition, and personnel
- Real-time Updates: Status changes are reflected across all units
-
Main Controller:
- Adjust strength levels affecting unit capabilities
- Send messages to all units or specific units
- Request unit information
- Control area clearance status
-
Units (Tank, Helicopter, Submarine):
- Perform unit-specific operations based on strength levels
- Send and receive messages
- Monitor resources (fuel, ammunition, personnel)
- Change position to enable/disable operations
The system implements the Observer Pattern:
Observableclass: Manages communication between unitsObserverinterface: Implemented by all units to receive updates
- Java Development Kit (JDK) 11 or higher
- NetBeans IDE (recommended for form editing)
- Clone the repository
- Open the project in NetBeans IDE
- Run the
Start.javafile in thesrc/Startdirectory
# Navigate to project directory
cd Defence-System
# Build the project using Ant
ant build
# Run the application
java -jar dist/Course_Work.jarThis project is provided for educational purposes only.
- Sadeepa Herath
