Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Re: Matrix multiplying using separate input classes and a GUI

    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.
  2. Re: Matrix multiplying using separate input classes and a GUI

    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...
  3. Re: Matrix multiplying using separate input classes and a GUI

    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...
  4. Re: Matrix multiplying using separate input classes and a GUI

    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...
  5. Re: Matrix multiplying using separate input classes and a GUI

    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
  6. Re: Matrix multiplying using separate input classes and a GUI

    Yes, now extend it
    Add a constructor to the MyButtonListener class that takes a MatrixMult type as a parameter.
  7. Re: Matrix multiplying using separate input classes and a GUI

    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.
  8. Re: Matrix multiplying using separate input classes and a GUI

    Have you made the changes I recommended for the MyButtonListener class?
  9. Re: Matrix multiplying using separate input classes and a GUI

    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...
  10. Re: Matrix multiplying using separate input classes and a GUI

    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...
  11. Re: Matrix multiplying using separate input classes and a GUI

    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...
  12. Re: Matrix multiplying using separate input classes and a GUI

    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....
Results 1 to 12 of 12