Raymond Cote | 1 Jul 21:37

How to restrict keystrokes in a TextField.

Hello,

I have a TextField which I'd like to limit to accepting only digits.

I've added a listener to the TextField and can grab each keystroke as it 
is entered.

However, I'm unclear as to how I could decide whether or not to let this 
keystroke through.
The TextField is not being updated until after I receive the keystroke, 
so I suspect there's something I can do to say "not this keystroke."

Any hints and pointers greatly appreciated.

Thanks
--Ray

------------------------------------------------------------------------------

Gmane