how do i close a frame yet open a new frame?
i have a frame, (help)
when i click on my menu item
i want to open (mainForm)
exit from help.
new mainForm().setVisible(true);
System.exit(0);
i know this closes the whole program however how do i get it to only close the current frame
thanks
If you no longer want to use the frame you could use
frame.dispose()If you just want to hide it use
frame.setVisible(false).If you extended a Frame and are trying to close it from within use
this.disposeorthis.setVisible(false).