Results 1 to 4 of 4
  1. #1
    tanalyw is offline Member
    Join Date
    Apr 2008
    Posts
    4
    Rep Power
    0

    Default How do I show * in a password prompt?

    Hi all,

    I would like to ask if it is possible for me to show * when user enter his/her input on console base after a prompt?

    e.g I prompt the following

    Enter password:

    When user enter his/her input, it show appear in the console as:

    Enter password: ******

    It is possible? if so, how? thanks

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    9

    Default

    Try the Sun tutorial on password fields.

    Welcome to the Java Forums!
    Please read the FAQ to get you started.

    See you around! :)
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  3. #3
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    having that on console "well, i dont know.... try to search for it"...

    but, if you like it to implement on GUI... there is a passwordfield, sincerely built it for you by SunMicroSystems....

    or if you like to have a challenge, you can also implement it on a textfield, the advantage is, you can monitor it's input. and can be manipulated.

    regards,
    sukatoa

  4. #4
    Join Date
    Apr 2008
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by tanalyw View Post
    Hi all,

    I would like to ask if it is possible for me to show * when user enter his/her input on console base after a prompt?

    e.g I prompt the following

    Enter password:

    When user enter his/her input, it show appear in the console as:

    Enter password: ******

    It is possible? if so, how? thanks
    use password field in java or if you are using swing then use jpasswordfield

Similar Threads

  1. accessing command prompt using java (netbeans)...
    By kureikougaiji in forum New To Java
    Replies: 6
    Last Post: 06-27-2008, 04:01 PM
  2. Password System help
    By quickfingers in forum New To Java
    Replies: 1
    Last Post: 06-23-2008, 07:18 PM
  3. Asking for password from a Servlet
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-27-2008, 09:05 PM
  4. netbeans 6.0 not show commpunent or show blank page
    By fahimaamir in forum NetBeans
    Replies: 1
    Last Post: 01-26-2008, 07:20 AM
  5. Replies: 2
    Last Post: 08-06-2007, 10:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •