+ 1
Why do you use this in actionListener???
like.... object reference.addActionListener(this).... what this is doing here???
4 Answers
+ 3
actionListener as the name sounds listens for actions especially click and when ENTER BUTTON is pressed. ActionListener class is an abstract class with an abstract method actionPerformed(ActionEvent e) which must be override. whatever code you wrote inside actionPerformed after overriding it will be executed whenever an action is performed (eg button click or Enter button pressed) on the object (eg. Button, TextField) in which the action listener is added
+ 3
You use that when you implement action listener class. use to refer to the action listener it inherited
+ 2
An ActionListener is an interface in package java.awt.event . It has only one method void actionPerformed(ActionEvent e)
0
lamidi...why do we use this within ()??



