I am creating an application that allows users to view lists of tasks stored in different databases. So what happens is that I have a list of names of databases available for viewing (stored as a text file). The program loads the first database into this list and displays the contents. Then from the menu, I allow users to select another database in the list. (It seems like, I want to see the tasks for Andy, and now Bob, and now Karl ...).
The problem is that I do not know how to update the interface so that the contents of the new database are displayed. It is trivial to delete the tasks currently listed, read from the database, and then repopulate. But I canβt get to this code (from my Singleton database driver), because I need access to the instance of my Runnable that was loaded in the EventQueue (all my JComponents are private, as with all the tutorials that I still have met). I look at the get / peek methods in EventQueue, but they don't seem to be what I need as they return AWTEvents, and I don't see any connection between AWTEvent and Runnable except for java.lang.Object.
So, is it possible to get the current runnable? How?
Thanks in advance for any recommendations.
source share