A combination of events can be used for the same listener; listening to i.e. when a certain key is pressed by adding a KeyAdapter's KeyEvent, and listening to when a certain button is being pressed by using the ActionListener's ActionEvent.
So if i.e. a "ok" button should do something one could write a listener class that do the following:
Class OkListener extends KeyAdapter implements ActionListener {
public void keyTyped(KeyEvent ke) {
// Code for what happens to the JTextField when a certain key is be pressed...
}
public void actionPerformed(ActionEvent ae) {
// Code for what happens to the JTextField when a button is clicked on...
}
} Hope this is of some help,
/Soo-Im