I have a GUI program that controls all the graphics, etc of the program, while another program has all the calculations the GUI program grabs to show in its program. Well I would like to have another program that uses Frame and implements ActionListener, and launch that program with the GUI program.
I have been able to make an instance of the calculations program, but how do I tell the GUI to launch another program as a whole, not just certain methods, etc, but launching the entire program as if I'm launching it by itself? The 3rd program is a real, working calculator I copied the code out of a java programming book, but would like to implement it into the main program launching everything (GUI).

After I'm able to do that, I want to have the calculator program only pop up when an action is taken, making the calculator PART of the GUI window, attached to it, one with it.

I'm sure it seems confusing so please ask questions.

You cannot do that. However what you can do is swap panels inside frame. Each panel would be different application. Do not forget to remove main method from them and for organization purpose put them in separate packages

swap panels inside frame? do you mean the calculator program? the mortgage calculator is using JFrame, the regular calculator uses Frame. And what do you mean swap? Please if you can, be more specific, maybe give an example?

I was successful in loading the other program through the GUI program with just the simple code

Calculator.main(null);

Just one problem, the program loads successfully just like a stand-alone program BUT once I close out of it, everything closes, when all I want is the Calculator program to close not everything. Help.

This article has been dead for over six months. Start a new discussion instead.