Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afa-farkhod/bmi-app
JavaFX application that allows users to compare the Body Mass Index (BMI) of individuals and export the results to a Word document.
https://github.com/afa-farkhod/bmi-app
bmi java javafx javafx-application javafx-desktop-apps maven
Last synced: about 1 month ago
JSON representation
JavaFX application that allows users to compare the Body Mass Index (BMI) of individuals and export the results to a Word document.
- Host: GitHub
- URL: https://github.com/afa-farkhod/bmi-app
- Owner: afa-farkhod
- License: apache-2.0
- Created: 2023-06-07T05:05:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-02T00:51:16.000Z (over 1 year ago)
- Last Synced: 2024-10-12T18:24:31.559Z (about 1 month ago)
- Topics: bmi, java, javafx, javafx-application, javafx-desktop-apps, maven
- Language: Java
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BMI-App
JavaFX application that allows users to compare the Body Mass Index (BMI) of individuals and export the results to a Word document.- [Body Mass Index](https://en.wikipedia.org/wiki/Body_mass_index) - is a value derived from the mass (weight) and height of a person. The BMI is defined as the body mass divided by the square of the body height, and is expressed in units of kg/m2, resulting from mass in kilograms and height in metres.
- The BMI is a convenient rule of thumb used to broadly categorize a person as underweight, normal weight, overweight, or obese based on tissue mass (muscle, fat, and bone) and height. Major adult BMI classifications are underweight (under 18.5 kg/m2), normal weight (18.5 to 24.9), overweight (25 to 29.9), and obese (30 or more). When used to predict an individual's health, rather than as a statistical measurement for groups, the BMI has limitations that can make it less useful than some of the alternatives, especially when applied to individuals with abdominal obesity, short stature, or unusually high muscle mass.
- BMI Formula:
- BMI Chart:
- BMI Basic Categories:
- BMI Comparison application that allows users to enter individuals' BMI information, compare the BMI values using a bar chart, and export the chart along with the data to a Word document.
- GUI Application main view:
- The main class is called `BMIComparisonApp` and extends the Application class from JavaFX, making it the entry point for the application.
- The class defines instance variables for UI components, including a table view (table), text fields (nameField, weightField, heightField, ageField), chart series (series), and a bar chart (chart).
- The `start()` method is the main entry point for the JavaFX application. It sets up the UI components, including labels, text fields, buttons, a table view, and a bar chart.
- The `exportToWord()` method is called when the user clicks the `Export` button. It saves the chart as an image file, creates a Word document using Apache POI, and inserts the image into the document.
- The `addUser()` method is called when the user clicks the `Add User` button. It retrieves input from the text fields, creates a new BMIRecord object, adds it to the table view, and clears the text fields.
- The `compareBMI()` method is called when the user clicks the `Compare` button. It clears the chart series and populates it with BMI data from the table view's BMIRecord objects.
- The `saveChartAsImage()` method is a utility method that saves the JavaFX chart as an image file using the WritableImage and ImageIO classes.
- The BMIRecord class is a nested class within BMIComparisonApp. It represents a record of an individual's BMI information, including their name, weight, height, age, and calculated BMI.
- The BMIRecord class provides methods to access the record's attributes and calculate the BMI based on the weight and height.
- Demo test run result:
- Demo video showing test run
https://github.com/af4092/BMI-App/assets/24220136/073aa601-999e-4e66-a6cb-2a78e2efc56f