Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes limit input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "limit input" Watch "limit input" New topic
Author

limit input

mike cool
Greenhorn

Joined: Oct 21, 2005
Posts: 24
hi all
how can i force the user to enter limit input
the type is short
limit is 3 digit
so he can only enter 3 digit
thx in advance
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Command line? Swing? JSP?


[Jess in Action][AskingGoodQuestions]
mike cool
Greenhorn

Joined: Oct 21, 2005
Posts: 24
command line or swing or both
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Command line, the only choice is a loop like



In Swing, you could use JFormattedTextField.
mike cool
Greenhorn

Joined: Oct 21, 2005
Posts: 24
thanks that helps
i have other part that i can't solve
let say input will be 16485(short)
how can i converted to 3 decimal digits 0.170 ??
 
jQuery in Action, 2nd edition
 
subject: limit input