I'd like to change the code below to present a yes or no option when a user clicks on 'X' but I'm afraid my java newbie skills don't stretch to it yet. Any suggestions please? I'd like to keep the code below as intact as possible in order to see what needs to be done differently for future reference.
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class WindowExit extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
JOptionPane.showMessageDialog( null, "Are you sure you want to close?" );
System.exit(0);
}
}