Trouble with Swing / Jframes

I'll try to explain as best I can... I am trying to create a frame that will be a "menu frame" and then based on which option the user picks (JButton) it will then run the version of the program they have picked.

So first window is just a menu with 3 buttons: Version 1, Version 2, and EXIT.

What is the best way to implement this?
I know I don't know much... but how do I get the other 2 programs I have already written in here and linked to the buttons I created?
(the other 2 programs fill the same size frame) Right now the buttons just exit out of the program as a placeholder.

You don't run the programs, you call the methods. If the other programs are inside a main, then take that code and declare it as a method and call the method. For arguments, You might want to add some JTextFields. Check the API for JTextFields.

You don't run the programs, you call the methods. If the other programs are inside a main, then take that code and declare it as a method and call the method. For arguments, You might want to add some JTextFields. Check the API for JTextFields.

At your "swing" code, you call the methods from the other classes. If you don't know how to do that I suggest you study some more on how to call and declare methods.

I know how to run, and maybe that is a bad way to word it, other methods... my "calculate" button calls on the "calculator" method to do the match and come back with the numbers...

but my big problem I guess is making so that if I click one of those buttons on that first piece of code that I put up, that it then hides/closes/whatever the menu window(frame) and opens up a new frame/window with all of the proper GUI and calculations.

Alternatively "clearing" the current frame and replacing that GUI with the GUI I used in the other programs would work as well.