JavaBeans persistence is not limited to the storage of Swing components. You can use the mechanism to store any collection of objects, provided you follow a few simple rules. In the following sections, you will learn how you can use JavaBeans persistence as a long-term storage format for your own data.
XMLEncoder has built-in support for the following types:
• All primitive types and their wrappers
• Enumerations (since Java SE 6)
• Collections and maps
• The reflection types
• The AWT types
• AWT and Swing components, borders, layout managers, and models
• Event ...