JTextField

Hi,How can I Listener every chane value in the jtextfield with out typing enter?I want to builld search to my list...(wene user typing on letter/s I whant to display in my jlist only this starting lettars...)Thank you,Yael :)
[260 byte] By [yael800] at [2007-11-26 12:16:47]
# 1
DocumentListener is the answerCreate DocumentListener; then field.getDocument().addDocumentListener()
hellbinder at 2007-7-7 14:53:20 > top of Java-index,Archived Forums,Socket Programming...
# 2

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..

yael800 at 2007-7-7 14:53:20 > top of Java-index,Archived Forums,Socket Programming...
# 3
I'm OK :)
yael800 at 2007-7-7 14:53:20 > top of Java-index,Archived Forums,Socket Programming...
# 4

> 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.

hellbinder at 2007-7-7 14:53:20 > top of Java-index,Archived Forums,Socket Programming...