File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Limiting text in a JTextField" Watch "Limiting text in a JTextField" New topic

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?

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!
I agree. Here's the link:
subject: Limiting text in a JTextField
It's not a secret anymore!