Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.08 seconds.

  1. Re: calling a changing variable from another class

    What have you tried? I already told you that you do it exactly the same way you create the Resources instance. Try something and post your attempt.
  2. Re: calling a changing variable from another class

    No, you're going to have one instance of Main- consider it the equivalent of your main method now. If you really want to pass a value back from another class (again, this seems like a bad design, but...
  3. Re: calling a changing variable from another class

    Well, first you have to create an instance of Main. You do that exactly how you create an instance of Resources.
  4. Re: calling a changing variable from another class

    Sort of. That was my first suggestion- pass the instance of Main into the Resources class, and call a setter in Main each time the value changes.
  5. Re: calling a changing variable from another class

    You aren't going to be able to implement this only in the Main class. You're only dealing with one thread here, so unless you add something to your Resources class, you aren't going to be able to...
  6. Re: calling a changing variable from another class

    Why do you need to do that?

    You could call the Resources code from an instance of Main (instead of just the main method), passing in a reference to this instance of Main. Then from your Resources...
Results 1 to 6 of 6