Answer the question
In order to leave comments, you need to log in
How to access an object of a class?
There is class A, on which JFrame is located, and on it JLabel, in class B there is a printText function for writing text on JLabel. There is a class B. How to call the printText function from class B?
Answer the question
In order to leave comments, you need to log in
Either make B public static final and call it like B::printText.
Either create object B in class A.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question