Hi,
I’m new in Java.
I use alternately various JPanel in a JFrame. And I would like to know how can I use a variable declared in a JPanel, in another JPanel?
Thank you for your collaboration.
Best regards.
Daniel
Printable View
Hi,
I’m new in Java.
I use alternately various JPanel in a JFrame. And I would like to know how can I use a variable declared in a JPanel, in another JPanel?
Thank you for your collaboration.
Best regards.
Daniel
Can you add a getTheValue() method to that class and have the code in the other class call that method? The other class would need a reference to the object with the variable, so you would need to find a way to give it the reference.