Time for more debugging. Add a print out of the event passed to the actionPerformed method to see that it is called and to show what it is getting.
Type: Posts; User: Norm
Time for more debugging. Add a print out of the event passed to the actionPerformed method to see that it is called and to show what it is getting.
You need to pass a reference to one class to the other. For example in Buttons pass a reference to itself (this) in the constructor of the Pushed class.
Pushed pushed = new Pushed(this);
and in...
That's the code I had you put in for debugging. You can comment it out now. Its for the case where you want to see the call stack to show who called a method.
What you've posted is the call stack which is verrrrrrrrrrrrrrrry long because of the recursion.
Now look at your code and play computer with it. Where does the cross calls to the creation of the...
What exceptions is it throwing? Please copy and paste the error message here.
Do you see the recursion?
The Buttons class creates a Pushed object:
Pushed pushed = new Pushed();
The Pushed class creates a Buttons object:
Buttons buttons = new Buttons();
The Buttons...
Your code is recursively calling itself. Add print outs to both of the constructors to see what I mean.
The following doesn't work because the problem is outside of the constructors.
To...
You can do that.
Look at how you are calling the addActionListener method. What type is the argument passed in the method call?
Yes, the Button class has an addActionListener method
You're missing my point. The Buttons class extends Applet. Neither of those two classes has a method: addActionListener
This last error message you posted shows another class that does NOT have...
Does the Buttons class have a method: addActionListener()?
Does the Buttons class have a method: addActionListener()?
What method contains the line with the errors?
Please copy the full text of the error messages and paste them here. Don't edit them.
Where do you add an actionListener to the Button object?