I need to do following things on a JTextField
1. Make sure only numbers are entered. Meaning that when a user presses a character on the keyboard nothing happens on the JTextField
2. Limit the entry to 4 digits.
3. Not allow -ve values
4. Once a valid value is entered, then on the enter key do something.
Please help me with this. Since I have tried all possible things in my capacity to figure out how to accomplish this.
Thanks In Advance