Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

limiting input from a textfield???

 
raymond yadao
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
How would i do to limit the input for a textfield?
For example, i used the constructor:
TextField tf = new TextField(10);
still it doesn't limit the input(let say 10 characters)??
thanks!
raymond
 
Michael Matola
whippersnapper
Ranch Hand
Posts: 1821
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may not be exactly what you want, but if you happen to use Swing instead of AWT, there's javax.swing.InputVerifier that can handle this sort of validation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic