Solved, close please

Discussion in 'Programming' started by ParaStyle, Sep 29, 2015.

Thread Status:
Not open for further replies.
  1. Solved
     
    #1 ParaStyle, Sep 29, 2015
    Last edited: Sep 30, 2015
  2. If I'm understanding this right: You want to pass a variable (specifically an Integer) between classes? If there is only one instance of this integer, try a public static?
     
  3. You can't define a public static int in the onCommand method.
     
  4. I don't believe he was trying to pass it in the onCommand method.
    Back to topic; I'd suggest making a private variable with a getter method, which is initialized in your command. Afterwards, create a constructor to which you can connect from the event class. Make sure your variable is initialized, otherwise you'll probably get a null pointer (can't say with certainty due to the fact I haven't seen your code).
     
  5. You can close this topic.
    Thanks to MarinD99
     
    • Like Like x 1
  6. JamesJ

    Supporter

    If you're wanting a thread closed, click the 'Report' button and just report it saying you'd like it closed.
    I've done it for you this time :)
     
    • Informative Informative x 1
  7. dtm

    dtm Retired Moderator
    Retired Supporter

    Thread locked per request.
     
Thread Status:
Not open for further replies.