A JavaFX-based desktop application that allows users to convert between currencies using live exchange rates fetched from an API.
- User-friendly graphical interface for seamless currency conversion.
- Supports four currencies: USD, EUR, JPY, and JMD.
- Live exchange rates obtained from a reliable API.
- Handles user input for amount and currency selection.
- Java 11 or higher.
- JavaFX SDK installed and configured.
- Active internet connection for API calls.
- API Key for Exchange Rate API.
- Clone or download this repository.
- Replace the placeholder API key in the code:
private static final String API_KEY = "YOUR_API_KEY_HERE";
- Input the Amount: Enter the amount you want to convert.
- Select the Currencies: Use the dropdown menus to choose the source and target currencies.
- Convert: Click the "Convert" button to see the converted value in the output field.
- Pause and Retry: The application handles invalid input by defaulting the exchange rate to 1:1 if the API fails.
- API Integration: Fetches live exchange rates.
- Dynamic Currency Selection: Allows users to select any two supported currencies.
- Responsive Design: The layout adjusts for optimal viewing.
getExchangeRate(String fromCurrency, String toCurrency)
: Fetches the exchange rate between the selected currencies using the API. Handles JSON responses using theorg.json
library.- Event Handling: Listens for user interactions like button clicks and text input.
- JavaFX for GUI development.
- org.json for JSON parsing.
- Defaults to 1:1 exchange rate if the API call fails (e.g., due to connectivity issues).
- Limited to four currencies. Add more currencies by modifying the dropdown menus and API query.
This project is released under the MIT License.
Alistair Chambers