In frame A, after click one button, frame B will be envoked. In frame B , after click button "close" , I want to close frame B, so I use: System.exit(0). , but all frames will be closed.
Can you tell me how to close just frame B ? thanks very much.
method on a reference to that frame. This will both hide the window and reclaim all resources - the frame can be shown again with a call to
Code:
setVisible
or similar, which will recreate the frame and its components.
Alternatively (Not recommended unless hyper-optimising for speed), you could just hide the window (
Code:
setVisible(false)
) and let the resources be reclaimed when the entire application exits. Note that threads owned by this frame will not be reclaimed in this way, so the application should (must) be stopped with
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.