I'm not sure how that is related to the NPE you are getting. You must change the code so a valid non null value is passed to the MyButtonListener constructor.
Type: Posts; User: Norm
I'm not sure how that is related to the NPE you are getting. You must change the code so a valid non null value is passed to the MyButtonListener constructor.
What is the value of the variable passed to the constructor? If you pass a null value then you'll get a NPE.
You need to pass a reference to an existing MatrixMult object that has or will have the...
I have given you guidance in many posts. But you didn't understand the terminology.
Look at posts starting at post#4, 6 and 8.
I have been saying the same thing since then.
Sorry about giving...
No. I did not say to create new instances of the MatixMult class.
I said to assign the parameter passed to the constructor (finalMatrix) to the class variable: c.
<REMOVED> // assign the parameter...
Now create a class variable of type MatrixMult in the MyButtonListener class
and in the constructor assign it the value of the MatrixMult argument passed in the constructor
Yes, now extend it
Add a constructor to the MyButtonListener class that takes a MatrixMult type as a parameter.
No, I said a constructor. I said nothing about changing the parameters to the actionPerformed method.
Add a constructor to the MyButtonListener class that takes a MatrixMult type as a parameter.
Have you made the changes I recommended for the MyButtonListener class?
Change the MyButtonListener class to have a constructor that takes a MatrixMult object as a parameter.
Add a MatrixMult variable to the MyButtonListener class.
Have the constructor save its...
What class creates the String you want in the listener?
How can you get a reference to that class in the listener?
One way is to pass a reference to the class with the String in the listener...
What data is in the new MatrixMult class instance you create in the actionPerformed method?
You need to have a reference to the instance of the class that has the data.
When you create an instance...
You have more than one variable named:resultant. This confuses me and probably confuses the compiler.
Rename one of them so there names are different.
Using static variables can cause problems....