Hello, If I want to dyamically build a GUI from an XML file where the number of containers will not be known untill runtime, what is the best method for tracking them? I currently am adding the created containers to a hash map. With a key deliminated in the XML file. Is this a good solution? Are there better ways? Many thanks. Tom
As an exercise, I'm building something myself to specify a Swing GUI in XML. If a name='aname' attribute is found on any component I put it into a Map. I can create the UI and then get or set values for any of the components. I can also create a listener or model component and reference it by Map key in multiple components.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Hello, see how it is done in JEasy. The hole GUI is stored in XML. To build panels and other components dynamically, JEasy offers a XML-Syntax to create new compnentns at runtime. To test it, run the Example from www.jeasy.de and chose the tabbedpane dynamic panel. Change the xml string at the left and build a form. Harry