A simple yet functional Body Mass Index (BMI) calculator built with Java and Swing GUI framework. This application helps users calculate their BMI based on height and weight inputs, providing instant health category feedback.
This BMI calculator is a desktop application that provides a user-friendly interface for calculating Body Mass Index. The application accepts user inputs for height (in centimeters) and weight (in kilograms), then calculates and displays the BMI value along with the corresponding health category classification.
- Simple GUI Interface: Clean and intuitive Swing-based user interface
- Real-time Calculation: Instant BMI calculation upon button click
- Health Category Classification: Displays BMI category (Underweight, Normal, Overweight, Obese)
- Input Validation: Ensures valid numeric inputs for accurate calculations
- Cross-platform: Runs on any platform with Java installed (Windows, macOS, Linux)
- Java: Core programming language
- Swing: GUI framework for desktop interface
- AWT: Abstract Window Toolkit for UI components
BMI_count/
├── src/
│ └── com/
│ └── bmi/
│ └── calculator/
│ └── Main.java
├── lib/
│ └── (dependencies if any)
└── README.md
- Java Development Kit (JDK) 8 or higher
- Visual Studio Code with Java Extension Pack (recommended) or any Java IDE
-
Clone the repository
git clone <repository-url> cd BMI_count
-
Open in VS Code
- Open the project folder in Visual Studio Code
- Ensure the Java Extension Pack is installed
-
Compile the project
javac -d bin src/com/bmi/calculator/*.java -
Run the application
java -cp bin com.bmi.calculator.Main
- Launch the application
- Enter your height in centimeters (cm)
- Enter your weight in kilograms (kg)
- Click the "Calculate BMI" button
- View your BMI value and health category
- Underweight: BMI < 18.5
- Normal weight: BMI 18.5 - 24.9
- Overweight: BMI 25 - 29.9
- Obese: BMI ≥ 30
The JAVA DEPENDENCIES view in VS Code allows you to manage your dependencies easily. More details can be found in the Java Extension Pack documentation.
Contributions are welcome! Feel free to open issues or submit pull requests for improvements.
This project is open source and available for educational purposes.