Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Question

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation Question

    Hi ! What would be the code in java to look my password in hidden?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Question

    Can you explain and post an example of what you are asking?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    May 2014
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Question

    I would like to know what is the code to hide the password
    for example
    My password is supercontra
    and I want you to look ***********

  4. #4
    Junior Member amitection's Avatar
    Join Date
    May 2014
    Location
    India
    Posts
    24
    My Mood
    Busy
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: Question

    Well u can have a look at this.
    How to Use Password Fields (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)

    The JPasswordField has a method which is setEchoChar(). As documentation states:

    Sets the echo character for this JPasswordField. ... Setting a value of 0 indicates that you wish to see the text as it is typed, similar to the behavior of a standard JTextField.

    You can then use just a JPasswordField and enable the echo character (eg. '*') just for the password.
    ăϻі†

  5. The Following User Says Thank You to amitection For This Useful Post:

    josselynmedina95 (May 10th, 2014)

Similar Threads

  1. Replies: 1
    Last Post: November 4th, 2013, 05:38 AM