I've made a Notepad program and i wonder how can i create a popup window which pops up when i click on the "close" button and ask the user if he would like to save the content which was written in the note pad.
I was think of JOptionPane as a solution but not sure how to add buttons to the window it creates and how to call the "popup" window.