I am currently learning the basics on JAVA GUIs.

And I made a Class that extends the javax.swing.JFrame Class.
The name of that class is MAINCLASS. On the form i made a swing menu.

I made a 2nd class that also extends the javax.swing.JFrame Class. This class has an input box and is called INPUTCLASS.

When the user hits the menu on the Mainclass, then it creates an instance of the inputclass and Shows it. The user needs to fill in the data in the textbox and then hit ok.

But now, how should I return the inputvalue to the MainClass?

Thank you in advance.