K
K
Kirill Romanenko2014-07-20 16:10:29
Java
Kirill Romanenko, 2014-07-20 16:10:29

What command will allow you to close a separate frame instead of an application?

Hello, masters) I'm still learning, I ask for advice.

Everyone knows that setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) terminates the application when the frame is closed.

But I have such a moment: the mine-window has an "Options" button in it. When you click on it, a window with application settings appears. There, of course, I will make an exit button, like "Done", but .. what should I write in it? And in the body of the Options window class itself there is a line setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) which kills the entire application completely if the options are closed. How to solve this problem? How to close a separate Options window when returning to the main application?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kot220487, 2014-07-22
@kot220487

Try hiding the modal with jqmHide().

A
a_f0x, 2014-08-07
@a_f0x

setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
in the method that you have in the listener hung on the output button
removeAll();
dispose();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question