Problem with DocumentListener
I posted this to the nbuser mailing list, but this is probably a better place to get a response.
I am a complete newbie to Java (after many years with Visual C++), and am writing my first project. I have hit a brick wall in NetBeans 5.5 trying to implement a DocumentListener. I noticed that even though I imported java.awt.* I also had to import java.awt.event.* to implement EventListener. So I have imported javax.swing.event.*, but NetBeans still cannot find DocumentListener. I get a "cannot find symbol" error, and the location is given as class javax.swing.JTextField.
These are the relevant bits of code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.event.*;
-
TopLevelListener tldl =new TopLevelListener();
-
topLevel =new JTextField(32);
topLevel.setMaximumSize(new Dimension(300, 25));
*topLevel.addDocumentListener(tldl);
--
*privateclass TopLevelListenerimplements DocumentListener
{
publicvoid insertUpdate(DocumentEvent e)
{
<some code>
}
}
I get error flags on the lines prefixed with *
Thanks for any help.

