Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

keyListner

 
vasu kasukurthi
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to implement key listner for passwordfield, if password field length is greaterthan 12 then the field doesn't allow to type text in passwordfields.

Thanks in advance
 
Kaustav Ganguly
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think if you are developing a web application using HTML then easiest way would be to use the password type in html and provide the maxlength attribute as 12. you dont need any key listener for this,

try this "<input type="password" size="12" maxlength="12" />"

 
Rob Spoor
Sheriff
Pie
Posts: 20369
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And for Swing applications, do a search in our Swing / AWT forum. This question has been asked, and answered, before.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic