Can I make a prompt before application exit using the WindowClosingListener interface?

Can I make a prompt before application exit using the WindowClosingListener interface? I was thinking something like shown in the code windo? Or is there a better way?
private class ApplicationCloseEvent implements WindowClosingListener {
 //make possible something before exit
}

Open in new window

SuppaiAsked:
Who is Participating?
 
SuppaiAuthor Commented:
Just what I needed
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.