You need to use setDefaultCloseOperation() and for resetting the values use some helper method that sets the values back to null or an empty string. I take it you mean textfields and label?
private void restore()
{
jLabel1.setText("");
.....
}
> Are you calling the setDefaultCloseOperation() method at all when initialising any/orr of your JFrames? If not then there will be a thread running in the background even after all of the frames have been closed.
i want when i press close button (X) on the title bar, it should hide JFrame and destroy it, not exit program.
what a parameter i should use with setDefaultCloseOperation( ? )?