automatic Jdialog box authentication

Posted on 2007-07-26
Last Modified: 2008-02-01
hello there,

i have a java web start application which displays a username/password dialog box wqhen the application i want to add a feature so that users can save the username password by clciking on a that when they next time start the application the program will start with out users to enter those details.can anybody provide some guide how to acheive this.

Question by:zolf
    LVL 37

    Expert Comment

    >> i want to add a feature so that users can save the username password
    >> by clciking on a checkbox.
    First, I don't think it's a good idea to save the password (security)
    To save the user name use the Preferences class:
    LVL 37

    Expert Comment

    So, when clicking the check box, you save the username ( Preferences.put() )
    When starting next time you check if a saved username is available (Preferences.get()) and if it is, you fill that one in the user name box.

    Saving: userPref.put("username", theUserName);

    Checking: String tmp = userPref.get("username", null);
                     if (tmp!=null) {
                          // Use it
    LVL 37

    Expert Comment

    btw, on a Windows machine this info is saved in the registry.


    If you use this:
    Preferences userPref =  

    userPref.put("username", theUserName);

    leads to an entry
    LVL 37

    Accepted Solution

    LVL 37

    Expert Comment

    Thanx 4 axxepting

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now