how do I amke a JFrame close itself, without quiting the program?
Check the javadoc. There should be something like:
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
no like is a user clicks a buttont hent he window closes
jFrame.setVisible(false) will hide it.
I think dispose() does what you want,but it may do more than you want it to if you read the javadoc (in which case, setVisible() should be enough)
k thanks
AFAIK as soon as the main window closes, the whole app will close. If the JFrame isn’t the main window, setVisible(false) will do fine.