How i can do textField accepts only letter "N or E" in Java? doesn't accept number and another characters.
textField.textProperty().addListener((observable, oldValue, newValue) -> {
if (newValue.length() > 1) textField.setText(oldValue);
if (newValue.matches("[^\\d]")) return;
textField.setText(newValue.replaceAll("\\d*", ""));
});
i tryed this, this worked for maxValue. But i am need textField accept only "N" and "E" characters. So how i can do this?