I have three classes. One is a worker class that does all the hard work but doesn't display anything. The other two are GUI classes one of which calls the other. The one that calls the second GUI class has the worker class open.
The first GUI calls the second with this method:
protected void openAdd() {
AddPet add = new AddPet(ADD_PROMPT, FIELDS, DATE_PROMPT);
add.setVisible(true);
}
The second GUI class is used to get information from the user that is used in the worker class but, as I already have the worker class open in the first GUI I don't want to open it again and I want to use some of the information in the first GUI.
What I need to do is pass that information in the second GUI back to the first GUI so that it can work with it and pass it to the open worker class.
How do I do this?
EDIT: I think the best option would be to call a method in the first GUI from the second GUI but I don't know if this is even possible.