Re: Object-oriented applet
Quote:
Originally Posted by
Norm
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 the Pushed class, receive the reference in a constructor:
Pushed(Buttons b) {
I understand what what you recommended I do: create a class whose constructor class the constructor of another class using the object created by the first constructor call as an argument to create an instance of the second class. However, when I try to run the applet now it still doesn't perform the action as written.
Re: Object-oriented applet
Quote:
when I try to run the applet now it still doesn't perform the action
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.