This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Preferences.exportSubTree() does not export all xml nodes  RSS feed

Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code should write information to a preferences file, that is expected to include left, top, width, height, and, title nodes, however, it does not seem to happen. Any idea how to update the code so that preferences are included within the preferences file exported from the File > Export Preferences option?

Source: Core Java Volume I (8th Edition) Listing 10-8 P. 546 to 549

preferences.xml - does not include nodes for left, top, width, height, and, title:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE preferences SYSTEM "">
<preferences EXTERNAL_XML_VERSION="1.0">
<root type="user">
<node name="com">
<node name="horstmann">
<node name="corejava">

"The actual storage of the data is dependent on the platform, e.g. under Windows the Windows Registry is used while under Linux a hidden file in the home directory of the user is used." Quoted from this article.

Does this code snippet save any entries in the Windows registry in my case? Can I look them up?

I am using Win XP SP3.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!