Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afa-farkhod/loan-calculator
Following API simply calculates the loan amount, where UI was built on eclipse windowbuilder, and main part in java
https://github.com/afa-farkhod/loan-calculator
gradlew java javafx-desktop-apps
Last synced: 1 day ago
JSON representation
Following API simply calculates the loan amount, where UI was built on eclipse windowbuilder, and main part in java
- Host: GitHub
- URL: https://github.com/afa-farkhod/loan-calculator
- Owner: afa-farkhod
- License: apache-2.0
- Created: 2023-03-30T03:38:40.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-01T09:50:04.000Z (over 1 year ago)
- Last Synced: 2025-01-02T00:09:22.130Z (1 day ago)
- Topics: gradlew, java, javafx-desktop-apps
- Language: Java
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Loan-Calculator
Following API simply calculates the loan amount, where UI was built on eclipse windowbuilder, and main part in java, building tool gradle was used.- After entering inside the project main source file folder, we run the following command:
- When api is built without issues, we can run and check program
- Testrun with sample input amounts:
## [Implementation](https://github.com/af4092/Loan-Calculator/blob/main/LoanCalculatorAPI/lib/src/main/java/loancalculatorapi/LoanClass.java)
- `UI.java` code snippet represents a Java Swing-based user interface (UI) class named `UI` in the package `loancalculatorapi`. It extends the `JFrame` class and provides a graphical interface for a loan calculator application. Here's a breakdown of the code:
- The UI class contains various Swing components such as `JFrame`, `JPanel`, `JLabel`, `JTextField`, and `JButton` to create the UI elements.
- The UI is initialized and configured in the constructor (`UI()` method).
- The UI elements are positioned and styled using the `setBounds()` and `setFont()` methods.
- Text fields (`tfInterestRate`, `tfNumberOfYears`, `tfLoanAmount`, `tfMonthlyPayment`, `tfTotalPayment`) are created to allow the user to input data.
- A `Calculate` button (`btnCalculate`) is created with an `ActionListener` that triggers calculations based on the user's inputs.
- The input data is retrieved from the text fields, passed to an instance of the `LoanClass` class, and the calculated results are displayed back in the text fields.- `LoanClass.java` code snippet represents a Java class named `LoanClass` in the package `loancalculatorapi`. It is used to perform loan calculations based on user input. Here's an overview of the code:
- The `LoanClass` class has private fields for `InterestRate`, `NumberOfYears`, and `LoanAmount`.
- A constructor is defined to initialize the `LoanClass` instance with the input values.
- Getter and setter methods are provided to access and modify the private fields.
- Utility methods (`parseInterestRate()`, `parseNumberOfYears()`, `parseLoanAmount()`) are defined to convert the input strings to `Double` values.
- The class includes methods (`getMonthlyPayment()`, `getTotalPayment()`) to calculate the monthly payment and total payment based on the loan parameters.
- Additional methods (`resultMonthlyPayment()`, `resultTotalPayment()`) convert the calculated values to strings for display.
- The `LoanClass` is used in the `UI` class to perform loan calculations based on user input and display the results in the UI.