• Post Reply Bookmark Topic Watch Topic
  • New Topic

formatting JTextField

 
James Knight
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would format a JTextField to not allow a value greater than 500 entered?

thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this might be one way, a bit long-winded though

 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could make a subclass of java.text.Format. I don't think a NumberFormat or a MaskFormat would give you that kind of flexability.

And use a JFormattedTextField.
[ March 09, 2005: Message edited by: Steven Bell ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!