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,107
  • 18
  • 130
  • 305
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
  • 111,301
  • 67
  • 311
  • 403