Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Exporting the User Type Preferences in a Subtree of Preference Node

                         

In this section you will learn that how a user can access the User preferences. Here we are going to make it easier to understand the step be step process by the complete example on this topic. If we consider the example it will display the preferences of the user as root type="user" after that it display the node name as in the output is "anshu", "roseindia" and then it'll display the map tree. In this way we can access the user preferences.

 

 

Here is The Complete Code : 

import java.util.prefs.*;
import java.io.IOException;

public class SavePref {
    public static void main(String[] args)
            throws IOException, BackingStoreException {
        Preferences root = Preferences.userRoot();
        root.exportSubtree(System.out);
    }
}

After thoroughly knowing the code you should save the file by "SavePref.java" file name and when after compiling the code you run your program you will get the output given below .

Here is The Output Of The Example :


C:\anshu>javac SavePref.java

C:\anshu>java SavePref
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
<preferences EXTERNAL_XML_VERSION="1.0">
<root type="user">
<node name="anshu">
<map>
<entry key="city1" value="delhi"/>
<entry key="intValue" value="2"/>
<entry key="booleanValue" value="true"/>
<entry key="UsageCount" value="3"/>
</map>
</node>
<node name="roseindia">
<map>
<entry key="One" value="Washington"/>
<entry key="Two" value="Jefferson"/>
<entry key="Five" value="Lincoln"/>
<entry key="Ten" value="Hamilton"/>
<entry key="Twenty" value="Jackson"/>
<entry key="HR" value="Deepak"/>
<entry key="Programmer" value="Amit"/>
<entry key="Team Leadere" value="Chandan"/>
</map>
</node>
</root>
</preferences>

Downoload this example.

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
java e-books
struts option tag
hibernate type
Photoshop Drawing Penc
<jsp:include> example
combobox using ajax
Flex Java Tutorial
Ñ?â??еâ?¬Ð°Ñ?â??вÑ?â
accessing database fro
Photoshop Effects Parc
ajax examples java
java.lang.ArrayIndexOu
jsp action tags
servlet quetion and an
cache in hibernate
how to call pl/sql fro
Stateful Session EJBs:
paging
IgnoreCase() in java
program in java to dra
change password using
previous year's date
input charaters in arr
dojo tree
insert fields blob
actions erros validate
how to convert a numbe
tuxedo
�¡?� ??�¡?� ??
image on click in jsp
Convert String to Bool
struts ejb hibernate i
mvc hibernate
precision
how to get the checkbo
The Java X10 Project
ASP Ad Management Rota
calculate the occurren
count the number of di
ASP Form Processing Se
hibernate findall
concatenate java
count line
circle
Connection Pooling cod
architecture
Display detailed cloc
BLAG Linux and GNU 300
how to join two table
struts file upload max
yield,stop,sleep in th
hybernate annotations
multithreads
how to concate two str
spring applicationcont
break�?????�??
jboss portal
Combo Box operation in
Connecting to the Data
implicit objects in js
PhotoshopScreenedRende
struts2 tag library
dispaly date in day mo
web.xml file
J2ME Gauge
Combattons la programm
cashier
OpenSourceInstantMessa
calling a bean from se
square root
getting integer input
mutator
xml
dirt
adding new cell to ex
ChatServer
increment
Photoshop Photo Effect
Ñ?Ð?Ð?Ñ?Ð??Ñ?Ð?Ð????Ñ?
database through jsp
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.