5 Replies Latest reply: Nov 19, 2010 10:36 AM by DarrylBurke RSS

    How to hide keyboard input in a Java console application?

    843790
      I am developing a console application that request a password, but I don't wanna the password to be shown in the console when the user enters it.

      The source code is something like that:
      System.out.print("Password: ");
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) ;
      String password = "";
      try
      {
             password  = in.readLine() ;
      }
      catch (IOException e) {}
      return s ;