You have to import java.awt.event*
then if you have a text field for example myTextField
you have to write a kinda special code, like:
myTextField.addActionListener (
new ActionListener()
{
public void actionPerformed (ActionEvent e)
// Whatever is gonna happen here
}
);
This is the way it works, the same goes for the other
listeners, but please check the API, I might have
misspelled something.