Please have a look at the JInternalFrame
Javadoc wrote:Sets the operation that will happen by default when the user initiates a "close" on this internal frame. The possible choices are:
DO_NOTHING_ON_CLOSE
Do nothing. This requires the program to handle the operation in the windowClosing method of a registered InternalFrameListener object.
HIDE_ON_CLOSE
Automatically make the internal frame invisible.
DISPOSE_ON_CLOSE
Automatically dispose of the internal frame.