Hey,
I am trying to find a way to limit how many characters a user can enter into a JTextField.
Does anyone know how to do this?
Thanks!
christiangirl 10 Junior Poster
Recommended Answers
Jump to PostPersonally, my first instinct would be to write a listener method that got the text, counted how many characters were there, and "refused to let more be entered" by setting the text back to whatever was previously there if the user entered too much. That would work, however, my first …
All 2 Replies
BestJewSinceJC 700 Posting Maven
Ezzaral commented: Good suggestion. +22
kvprajapati 1,826 Posting Genius Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.