Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
friki data migration
Ranch Hand
Posts: 772
  • Mark post as helpful
  • send pies
  • Report post to moderator
This code sample shows how to create a text field that only accepts digits as input. The idea comes from the API documentation of class JavaDoc:java.lang.JTextField, but this is a more complete example.

Note that the input is matched against a regular expression. If you need a text field for something different than numbers, you can easily change the regular expression to match the input that you want from the user.

CategoryCodeSamples CodeBarn
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!