HELP!! Close a JFrame closes whole app



I have an application that extends JFrame.

When a user presses a button, a smaller JFrame is also opened.

But when the user clicks on the box with an x in the menu bar of the
smaller JFrame to close the small JFrame, the whole app closes.

How can I fix this problem, so only the smaller JFrame closes and not
the whole app??

.