WeatherApp is a simple Java-based application that retrieves and displays weather information for a given location. It uses data from public APIs and provides an easy-to-use graphical user interface (GUI).
- Search weather by city name.
- Displays current weather condition, temperature, humidity, and wind speed.
- Provides visual icons for different weather conditions (e.g., clear, cloudy, rain, snow).
- Simple and responsive GUI built with Swing.
- Java 17 or higher.
- Internet connection to fetch weather data.
- Public weather and geocoding APIs:
- Open-Meteo (for weather data): https://open-meteo.com/
- Open-Meteo Geocoding API.
-
Clone the repository or download the source code.
git clone https://github.com/GN-SR/WeatherApp.git
-
Navigate to the project directory.
-
Compile the project using a Java IDE or the command line.
-
Add your project assets (icons and images) to the
src/assets
directory:clear.png
(Clear weather icon)cloudy.png
(Cloudy weather icon)rain.png
(Rain weather icon)snow.png
(Snow weather icon)humidity.png
(Humidity icon)windspeed.png
(Windspeed icon)search.png
(Search button icon)
-
Run the application.
java -cp bin AppLauncher
WeatherApp/
├── src/
│ ├── assets/ # Icons and images
│ ├── WeatherApp.java # Core logic for fetching and processing weather data
│ ├── WeatherAppGUI.java # Swing GUI implementation
│ ├── AppLauncher.java # Entry point for the application
├── README.md # Documentation
└── ...
- Enter the city name in the search bar.
- Click on the search icon or press Enter.
- View the weather details displayed on the GUI.
- Open-Meteo Weather API: Used for retrieving weather data such as temperature, weather condition, humidity, and wind speed.
- Geocoding API: Resolves city names to latitude and longitude.
- The application depends on public APIs, so ensure the API endpoints are available and functional.
- Make sure all asset files are present in the specified
src/assets/
directory.