Hello DaniWeb community! I come to you in need of some guidance on a quite frustrating problem.
In a nutshell, I am building a java system in which users can keep track of weather forecasts at a list of registered locations, which they can add or remove from their "watchlist".
I have built the database infrastructure and a login system which all works fine, but I am struggling with how to handle the next task, which is representing a user's watchlist in some visible medium. I have currentley stored a user's "watchlist" in another MS Access database with the user's ID and a String of the name of the location they are watching.
My plan is then to convert this into tangible Location objects which can then have their weather statistics changed. I have devised a method that creates these Location objects on the fly by creating them as the method queries the ResultSet of the watchlist database. These Location objects are then stored in an ArrayList.
NOW, here is my problem. I am trying to basically fill the ArrayList with the appropriate locations in one class, then "unpack" the list in a GUI class, and add the contained Location objects to some visible list (perhaps a JList). I have been trying to use XMLEncoder/Decoder to accomplish this by unpacking the ArrayList into another local ArrayList in the GUI class, but this hasn't worked. I keep getting "java.lang.InstantiationException"s.
Can anybody give me some help on a process like this? I am just trying to export the correct set of Location objects to a GUI class where they can there be displayed and manipulated accordingly.
Many thanks in advance for any help. I feel as though my project has hit a standstill - I just can't figure out how to solve this task...