How does a jframe communicate with other classes
Hello people, sorry for my bad english and for my question that can be very dumb. But how does the frame communicate with other casses?
Ok, my situation is the follow, i have a main class that contains :
1- a array of class 'employees' and
2- two 'frames' ( 'startscreen' and 'addemployee' screen)
My intention is:
1- in main class run the main frame ( asking if u want to add employees) then
2- in addemployee, to grab data from the textfield of the created frame to create personalized employees and add them to the array of the main class when someone press the jbutton.
My doubt is how will be the communication.
What must i do?
I call the second frame inside the first one? But if i do this, how will it communicate with the main screen?