textField.setDocument(myDocument);
public boolean canBecomeValid(String s)public void insertString(int offset, String s, AttributeSet attributeSet)