I am using JDK 1.4.0 (obviously, as I have problems with XMLEncoder...
)
What I need to do is create a JFrame with some Swing components inside (JPanel's, JLabel's, etc.), to save it as an XML file and be able to restore it later.
Everything went OK at the beginning, but there came the time to manage the layout part. For various reasons, the most appropriate layout manager for my application is SpringLayout.
The first step was again OK: when defining a SpringLayout for a panel, this property was transferred to the XML by XMLEncoder and restored by XMLDecoder.
But then, the happy days are over! In order for a SpringLayout to work, one must obviously define lots of SpringLayout.Constraints, using Spring's. But none of these things are transferred by XMLEncoder to the XML.
And, quite naturally, even if I modify manually the XML to include some constraint info, the XMLDecoder won't read that info!
Does anybody know if there is any trick about this? Or is there a known bug concerning the serialization of Spring's, and you know about a workaround?
Thanks a lot,
Adrian