0

I have a jframe with a text field. I want to ask how can only accept input text field containing numbers, so when users enter the letters will not be accepted

mKorbel
  • 109,525
  • 20
  • 134
  • 319
dtnder
  • 381
  • 2
  • 10
  • 25
  • have a look into the tutorial referenced in the [swing tag wiki](http://stackoverflow.com/tags/swing/info) - it has more than one chapter dedicated to textfields and how-to achieve basic goals :-) – kleopatra Nov 14 '12 at 09:06

1 Answers1

4

Use DocumentFilter: example.

Also see:

Community
  • 1
  • 1
Eng.Fouad
  • 115,165
  • 71
  • 313
  • 417