Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    7
    Views
    1,264

    Re: Passing variable from one class to another

    Post the code where you create an instance of the Tuna class using the new operator.

    Compare that statement with the code that creates a new instance of the JLabel class in post#5


    See how to...
  2. Replies
    7
    Views
    1,264

    Re: Passing variable from one class to another

    When you create an instance of the Tuna class you would pass the String in its constructor the same way the String is passed to the JLabel class's constructor:

    q1 = new JLabel(user1); // pass...
  3. Replies
    7
    Views
    1,264

    Re: Passing variable from one class to another

    You could pass the String: user1 in the Tuna class's constructor.
Results 1 to 3 of 3