Okay here goes,
When the user closes the JFrame I want them to be prompted to confirm that they do want to close it.
I am listening for the WindowClosing event but I don't think that is correctly. If the window closing event is called, does that mean it is too late to stop it from closing?
More precisely, this code is executed but I have no clue how to stop the window from closing. Do I have to listen for a seperate event or is there something I can add here?
This is my code for the listener...
Thanks,
Ron
typedef map<GiantX,gold, less<std::shortestpathtogold> > AwesomeMap;
When the user closes the JFrame I want them to be prompted to confirm that they do want to close it.
I am listening for the WindowClosing event but I don't think that is correctly. If the window closing event is called, does that mean it is too late to stop it from closing?
More precisely, this code is executed but I have no clue how to stop the window from closing. Do I have to listen for a seperate event or is there something I can add here?
This is my code for the listener...
Code:
[blue]
public void windowClosing(WindowEvent arg0)
{
if (JOptionPane.showConfirmDialog(null,"Are you sure you want to exit?","Exit?",JOptionPane.YES_NO_OPTION)==1)
{
ShutdownSockets();
} //END IF
} //End Window Closing
[/blue]
Thanks,
Ron
typedef map<GiantX,gold, less<std::shortestpathtogold> > AwesomeMap;