This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFormattedTextField for Number only  RSS feed

 
Vishal Patel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to block charctor written in JFormattedTextField.

I had tried this.
JFormattedTextField(new MaskFormatter("#####"))
This blocks the Charctors.
But i must enter number with length of 5 digit.

I want make it with any length.

Plz help me.

Regards ,
Vishal Patel
 
Jim Williams
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured out you have to add this line also.

myTextField.setFocusLostBehavior(JFormattedTextField.COMMIT);

I found that you have to do this if your number of mask characters are > 1.
[ October 14, 2004: Message edited by: Jim Williams ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!