M
M
mazt_ser2020-12-15 19:04:53
Java
mazt_ser, 2020-12-15 19:04:53

How to set custom method on click on cross in swing java?

It is necessary that when one window is closed, the method is executed, and then the closing of this window. Prohibit to close the window and make the button "Exit" will not work. I want something like this
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
doSomethin();
}
});
Only for the setDefaultCloseOperation method

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2020-12-15
@mazt_ser

It? https://stackoverflow.com/questions/16295942/java-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question