• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to limit text length?

 
Rambo Rambabu
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there anyway we can limit the text length for swing JTextField components? For Example, I want to set a 30 char limit on a Name field on my screen. Instead of writing listeners and checking the length in code, is there any parameter I can set/pass so that swing itself would take care of it?
thank you,
Rambo
 
Rambo Rambabu
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind. I found the answer in the following posting..
http://www.coderanch.com/t/330598/GUI/java/limit-text
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic