Class for Password Masking at the time of taking input through console

  1. indianTechnocracy profile image37
    indianTechnocracyposted 6 years ago

    Class for Password Masking at the time of taking input through console

    Is there any special class in java which gives facility to mask the password characters which is taken through console ,if yes can u give me link of example or example of that class ???

  2. dipless profile image83
    diplessposted 6 years ago

    Hi this is pretty simple just use the TextField class, then use the  setEchoChar and set it to what you want, for example:

    TextField password = new TextField(8);
    password.setEchoChar('*');

  3. indianTechnocracy profile image37
    indianTechnocracyposted 6 years ago

    thnx dipless,but this is for if I make a Window class,I want it as how we can get enterred input thr. scanner class or BufferedReader class like that is there any facility to get entered password with masking character.
    Console class provides masking with space,but I want to use special char instead of space.

 
working