Here is an approach that you can try..
create an xml schema to represent your computer parts
use jaxb compiler, xjc to generate jaxb annotated
java bindings for this schema (java classes)
when you want to save have the toplevel java class populated with values and marshall it using jaxb.
To do this..
create a javax.xml.bind.JAXBContext.
and do
jaxbContext.createMarshaller()
and call .marshall() on the marshaller obtained.
to the .marshall() method you pass a JAXBElement<SomeClassGeneratedByJaxB>
and SomeClassGeneratedByJaxB will be an ojbect already populated by your program through the GUI
when you want to load use a persisted xml file and unmarshal it using jaxb
Like this..
you do a .createUnmarhaller()
and call .unmarshall()
to the .unmarshall() you pass your xml file in some form (look up the api)
cast result from calling .unmarshall() to a JAXBElement<SomeClassGeneratedByJaxB>
then call jaxbElement.getValue() to get your SomeClassGeneratedByJaxB