Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Swing / AWT / SWT
TextField in awt
sun moon
Greenhorn
Posts: 28
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi,
I want to limit upto 5 characters the in textfiled.
please help me out in this
Nathan Pruett
Bartender
Posts: 4121
I like...
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
"
sun moon
" -
Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy
.
You can change it
here
.
There's actually already an answer to your question in
this post
.
Thanks! and welcome to the JavaRanch!
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Nigel Browne
Ranch Hand
Posts: 704
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you had read the API documentation you would know that it is as simple as:
TextField tf = new TextField(5);
Paul Stevens
Ranch Hand
Posts: 2823
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Nigel that does not limit the user to 5 characters. That only applies to display.
Rama Ituarte
Ranch Hand
Posts: 62
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Create a class that extends javax.swing.text.PlainDocument. In you subclass override the insertString(in,
String
,AttributeSet) method.
Rama
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
<sx:tabbedpanel with textbox issue
limit characters number in a TextField?
Font resizing issue in PDF using IText Library
set a char limit in TextField
ToolTipText doesn't work
More...