Thanks..
I did this:
txtf.setDocument(new MyDocument());
txtf.getDocument().addDocumentListener((DocumentListener) this);
I must to cast (DocumentListener) , But if I casting, I get error about the cast..
> txtf.setDocument(new MyDocument());
You don't have to create any Documents, it's created by itself along with creation of JTextField.
> txtf.getDocument().addDocumentListener((DocumentListener) this);
> I must to cast (DocumentListener) , But if I casting, I get error about the cast..
Why do You need to cast anything? Implement DocumentListener.