Was mir nicht gelingen will, ist mehrere Knoten anzulegen (zwecks Übersichtlichkeit...). EINEN kann ich anlegen, mehrere nicht...
What's wrong?
Code:
FileOutputStream fos = null;
try {
prefs = prefs.node("/Knoten 0");
prefs.put("Key0", "Value0");
prefs.put("Key1", "Value1");
prefs.flush();
//prefs = prefs.node("/");
prefs = prefs.node("/Knoten 1");
prefs.flush();
prefs.put("Key2", "Value2");
prefs.put("Key3", "Value3");
prefs.flush();
}
catch (Exception ex1) {
}
try {
fos = new FileOutputStream(new File("test.xml"));
prefs.exportNode(fos);
}
catch (Exception ex) {
ex.printStackTrace();
}