This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Limiting text in a JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Limiting text in a JTextField" Watch "Limiting text in a JTextField" New topic
Author

Limiting text in a JTextField

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
Is there a way to limit the amount of text that can be typed
into a JTextField?

Thanks.
Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
Hi barry -

Here is a link to the code which shows how to limit input. Hope this helps!

http://www.rgagnon.com/javadetails/java-0198.html
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Limiting text in a JTextField
 
Similar Threads
how to increase the size of the text field and change its position ?
Jtext problem very urgent
I would like save the user inputs form JTextField ab,l m,n,o etc. how can I do this please help
JTextField Word Wrap??
automatic scrolling of JTextField