@Override public void replaceText(int start, int end, String text) { super.replaceText(start, end, text); if (!validate(text)) { undo(); } }
@Override public void replaceText(int start, int end, String text) { if (text.matches("[0-9]*")) { super.replaceText(start, end, text); } }