closing multiple JFrames
I have JFrame1 that contains a button. This button when clicked creates multiples of JFrames, a minimum of 3. However, I wanted to add a button that will close those JFrames i opened..
[191 byte] By [
chiwena] at [2007-11-26 18:17:54]

> one more thing, can i keep track all of the windows> that are open? can I decipher which is which?of course. whenever you create one, stick a reference to it in a collection. if you want to track them by name or something, use a Map of some sort, like HashMap
hmmmm, a new concept to me.. I'll research about it. The application creates those frames inside a looping statement, is it possible to map that. Thanks
Note that setVisible(false) only hides the frame (and afterwards it can be set visible again), whereas dispose() releases all resources used by that frame as well (and it cannot be restored). The method setDefaultCloseOperation(int) only sets the action taken when the user clicks on the x that closes a window.
#