setting the max of TextField


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: setting the max of TextField

  1. #1
    Join Date
    Oct 2004
    Posts
    6

    setting the max of TextField

    Hi, how do I set the max of a textfield? I've read through the docs and I've tried getPreferredSize but that doesn't seem to work. Any ideas?
    Thanks.

  2. #2
    Join Date
    Oct 2004
    Posts
    311
    To set a max number of characters to a textfield, you'll need to go through the event listener. I don't know off hahnd which one though. A textfield (or any input filed for that matter) throws an event each time a character is typed. You can listen for this event, and take action when it occurs. In your case, the appropriate action would be to erase the lastly typed character (and maybe show a small popup stating no more characters)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center