This repository contains a simple Java Swing application that fetches and displays weather information for a specified city. The application uses the OpenWeatherMap API to retrieve weather data and displays it in a user-friendly GUI.
- City Search: Enter the name of a city to fetch its weather information.
- Weather Details: Displays detailed weather information including temperature, humidity, and wind speed.
- Weather Icon: Shows an icon representing the current weather condition.
- Theme Toggle: Switch between light and dark modes for a comfortable viewing experience.
- Java Development Kit (JDK) installed on your system.
- An API key from OpenWeatherMap. You can obtain one by signing up on their website.
- Clone the repository to your local machine.
- Open the project in your preferred Java IDE.
- Replace the placeholder API key in the
fetchWeather
method with your actual OpenWeatherMap API key.
String apiKey = "YOUR_OPENWEATHERMAP_API_KEY";
- Run the application.
- Enter the name of a city in the input field.
- Press Enter or click the "Get Weather" button to fetch the weather information.
- The application will display the weather details and an icon representing the current weather condition.
- Use the "Toggle Theme" button to switch between light and dark modes.
Contributions are welcome. Please feel free to submit a pull request or open an issue if you find any bugs or have suggestions for improvements.
- OpenWeatherMap for providing the weather data API.
- Java Swing for the GUI framework.
For any questions or feedback, please open an issue on this repository.