Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to accept only numbers and whitespace in java

char text_in_patient_contact = evt.getKeyChar();
        if (Character.isDigit(text_in_patient_contact)||Character.isISOControl(text_in_patient_contact)) {
            medicine_name_input.requestFocus();
            patient_input_error.setText("");
        }
        else{
             patient_input_error.setText("Worong Phone");
        }
 
PREVIOUS NEXT
Tagged: #accept #numbers #whitespace #java
ADD COMMENT
Topic
Name
8+6 =