go to previous page   go to home page   go to next page

Answer:

No. In a complex application with many frames, you probably want only to close the frame who's button you clicked. You probably want to keep the application running.


setDefaultCloseOperation()

The setDefaultCloseOperation() method is used to specify one of several options for the close button. Use one of the following constants to specify your choice:

If you forget to call setDefaultCloseOperation() you will get JFrame.HIDE_ON_CLOSE by default. This can be frustrating, because it looks like you have "killed" the program, but it keeps on running, and you see no frame.


QUESTION 7:

Could different frames pick different close operations?