This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Regarding maximum length a user can enter. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Regarding maximum length a user can enter." Watch "Regarding maximum length a user can enter." New topic
Author

Regarding maximum length a user can enter.

Ixus See
Ranch Hand

Joined: Jul 17, 2011
Posts: 160
Hello Guys,

I realize if name and location are 64 bytes... that means it can store a string that is up to 64 length

Does that mean search function must allow up to 64 alphabet long?
Roel De Nijs
Sheriff

Joined: Jul 19, 2004
Posts: 7069
    
  28

That's not a must requirement, but I chose to have my GUI as restricted as possible. So user can't enter more chars than needed, can only enter digits in the port number field,...


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
OCAJP 7
Ixus See
Ranch Hand

Joined: Jul 17, 2011
Posts: 160
how do you do that? please don't tell me is add keystroke listener =x
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2270
    
    3

In our case, what we can do is restrict the text field where the user provides the customer ID, so it only allows numbers. I don't have my code here, but I did something similar to this.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Roel De Nijs
Sheriff

Joined: Jul 19, 2004
Posts: 7069
    
  28

Ixus See wrote:how do you do that?

More info can be found here.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Regarding maximum length a user can enter.
 
It's not a secret anymore!