June 10, 2017 natrivera

My latest creation will show you the weather in your current location using your public ip, or you can enter a zip code and it will return the forecast for that location.

I used a variety of tools including:

Let’s go through the logic as briefly as possible.

  • Get current location using the IP API via the user’s ip address
  • From the location results, extract the latitude and longitude in xml format
  • Use this latitude and longitude to run a weather api request also in xml
  • Extract information, including the forecast for the next five days
  • Display information on the gui.
  • If user enters a zip code, do same as above but with zip code

The project includes three classes, WeatherApp, WeatherUtility, and Forecast.

  • WeatherApp holds the gui jform as well as the main method.
  • WeatherUtility is where all the work is done.
  • Forecast is used to create an object of each of the results obtained from the weather api.

View the source files on Github.

Download the app from http://natrivera.com/WeatherApp.jar


Leave a Reply

Your email address will not be published. Required fields are marked *

Let's get in touch.

Reach me at Nat@NatRivera.com
Or simply fill out this form.