To limit the text field to numeric input, use the NUMERIC constraint in its constructor. To convert its value to an integer, use method Integer.parseInt(String). To check each value the user enters, add an ItemStateListener to the text field's enclosing Form, and in the itemStateChanged method, check if it's the text field that changed, and if so, whether the new value is OK. If not, display an Alert, and probably set the text field back to the preceding valid value. (Note: I've not used ItemStateListener myself - this is just from reading the JavaDocs).