• Post Reply Bookmark Topic Watch Topic
  • New Topic

security password  RSS feed

 
francis sumaylo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys, is there anyone knows how to make sa secure input. example: you entered password you type "Password: Hello" but it will be shown as "Password: **** ".
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Swing check out JPasswordField.
On the console check out java.io.Console and its readPassword methods. Those will not show *s but nothing at all.
 
francis sumaylo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you... is there easiest way? im just making a simple program with JOptionPane.showInputDialog(.....
 
fred rosenberger
lowercase baba
Bartender
Posts: 12562
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would think the way Rob suggested IS the easiest way.
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JOptionPane can take complete JComponents as its message. You would need a bit more work, but it would still be quite easy:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!