how to restart a program?

my program has many JFrame open at the sametime, and many attribute...etc, how i close all JFrame, reset all attribute but not end program?thanks
[166 byte] By [NhTina] at [2007-11-26 17:12:48]
# 1
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.
Tillermana at 2007-7-8 23:40:41 > top of Java-index,Java Essentials,New To Java...
# 2

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("");

.....

}

kikemellya at 2007-7-8 23:40:41 > top of Java-index,Java Essentials,New To Java...
# 3

> 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( ? )?

NhTina at 2007-7-8 23:40:41 > top of Java-index,Java Essentials,New To Java...