Home Java Example Java Util Removing a Preference Node
Questions:Ask|Latest



Removing a Preference Node
Posted on: January 12, 2009 By Deepak Kumar
This section demonstrates you to remove the Preference node

Removing a Preference Node

     

This section demonstrates you to remove the Preference node. You can see in the given example that firstly you have to get the specified node using the method userRoot().node("/Roseindia Employees") method. Then use the removeNode() method of Preferences class which removes this preference node and all of its descendants, invalidating any preferences contained in the removed nodes.

Here is the code:

import java.util.prefs.*;
import java.io.IOException;
public class RemoveNode{
  public static void main(String[] args)throws IOException, BackingStoreException {
  Preferences prefs = Preferences.userRoot().node("/Roseindia Employees");
  prefs.removeNode();
  }
 }

Download Source Code:

 


Recommend the tutorial

Ask Questions?    Discuss: Removing a Preference Node  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments