USING ACTIONLISTENER IN APPLET

Hi
How can we use the interface ActionLisener in an Applet.Currently I have used it in the following way.
public class xyz extends java.applet.Applet{
public void init()
{
Button b =new Button ("CUT");
b.addActionListener(new PDL());
add(b);
}
public class PDL implements ActionListener{...
...
}
}
But the compiler is giving the error that PDL is an abstract class and hence it can't be instantiated and that the method java.awt.event.ActionListener not found.
LVL 2
sun307Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sun307Author Commented:
Edited text of question.
0
samersCommented:
did u implement the method actionPerformed in ur class PDL.
0
OviCommented:
import java,awt.Applet;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class xyz extends java.applet.Applet{
 public void init()
{
   Button b =new Button ("CUT");
   b.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent e) {
       ---here comes your implementation
       }
});
   add(b);
}
}


-------- tested and applied succesfully
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.