![]() |
problem in java
i have the following code:
Code:
import java.applet.*;addActionListener(java.awt.event.ActionListener) in java.awt.Button cannot be applied to (Revolve) why? |
The object that listens for action must implement ActionListerner, your applet does not.
|
how can i solve it?
|
As Josh just said if you want to use the addActionListener method you need to implement the ActionListener class.
public class Revolve extends Applet implements ActionListener { } |
And you must define all the methods in the ActionListener interface. I think theres only one (I could be wrong) but its:
public void actionPerformed(ActionEvent evt); if I'm not mistaken. |
Yes you must also define that method. Something like this for example:
PHP Code:
|
Or in your case since you have a button you could define it like so:
PHP Code:
|
| All times are GMT +1. The time now is 03:46 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.