📄 e416. retrieving the parent and child nodes of a preference node.txt
字号:
// Get a node
Preferences prefs = Preferences.userNodeForPackage(java.lang.String.class);
// Get the parent
Preferences node = prefs.parent(); // /java
node = node.parent(); // null
// Get the names for nodes under java.lang
String[] names = null;
try {
names = prefs.childrenNames();
} catch (BackingStoreException e) {
}
// Get the child nodes using the names
for (int i=0; i<names.length; i++) {
node = prefs.node(names[i]);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -