For a start: look at the code in your opening post:
You do not implement an ActionListener at all. In fact, code is executed (lines 2-8) in a place where that should not be allowed. See Campbells remark about this.
But normally an Action is of the form:
and perhaps a little later:
I wrote a small program with two frames and a button in one of them, and that button controlls the visibility of the second frame. It is not exactly what your program does, but it shows that the second frame is not blank, and how to keep the visibility and the button in sync. Using two frames and controlling when one of them is closed, or iconified et cetera is certainly not so easy.
My demo, in case you are interested, can be found on my GitHub account, GitHub
, in the src map, ScottEricCatalano.java