Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    14
    Views
    1,354

    [SOLVED] Re: Updating The Components

    As you have discovered there is more than one way to solve the problem:
    Pass a reference in:
    the constructor where it is saved for later use
    the method call where it is used
  2. Replies
    14
    Views
    1,354

    [SOLVED] Re: Updating The Components

    See post #6 for a short piece of code that passes a reference to a constructor and has the constructor save the reference in a class variable.
  3. Replies
    14
    Views
    1,354

    [SOLVED] Re: Updating The Components

    That's another way to do it.
  4. Replies
    14
    Views
    1,354

    [SOLVED] Re: Updating The Components

    Use the reference to the MainWindow object that is passed to the constructor.

    m.setYazi("Suitable. Count: "+sayac+");
    In the above, m should be the reference that was passed to the Hail class....
  5. Replies
    14
    Views
    1,354

    [SOLVED] Re: Updating The Components

    Where is there a reference to the existing instance of the MainWindow class? If the code in the MainWindow class is calling the constructor, use the this variable. this refers to the class where the...
  6. Replies
    14
    Views
    1,354

    [SOLVED] Re: Updating The Components

    You need to make a reference to the existing, visible window available to the code that wants to use it.
    One way would be to pass the reference in the call to the Hail class's constructor and have...
  7. Replies
    14
    Views
    1,354

    [SOLVED] Re: Updating The Components

    How many MainWindow objects are created by the program? Add a println statement in the constructor that prints a message so you will know.

    How many should it create?

    What if one is visible and...
Results 1 to 7 of 7