posted 19 years ago
Howdy all,
I have a Swing mockup for a program in which I have created all relevant sections of the application as separate objects. So I have a SearchPanel object, in which the client types in a number and hits the search button, or the update button to update the database. Another object is the PatientData object, which merely displays all relevant patient data, etc. Each of the objects extends a JPanel, and in another object I compose them altogether in a JFrame. The main impetus for doing this was because I'm using JDeveloper's GUI building tools, and it's nice to be able to focus on each area of the appication in solitude.
I also have a dataStructure object in which I store all the data that will be updated in the database due to the client changing the data displayed in the Swing app.
Now,the problem I'm running into is how to register the dataStructure object with the relevant swing objects as receiving their event objects. The dataStructure object doesn't know anything about the Swing objects, because I create it in the main() method of the runtime object. So how am I to register the dataStructure with say a JButton in the swing app for instance? I could write a method is the object that contains the JButton, which accepts an instance of the dataStructure object and can therefore register said instance, but how do I call that method from the dataStructure object, considering the dataStructure object doesn't know that the swing app exists?
I realize this is a bit rambling, and I can be more concise if need be, as in code and class structure, so any help would be apprecitated.
Cheers.
[ July 27, 2005: Message edited by: Elam Daly ]