Prevent window from closing by "x" button?

I want people to be able to run my application in a windowed mode if they choose. However, in order to terminate everything in the right order, I'd prefer if people used the menus to exit the game. So I want to "turn off" the "x" button at the top right corner of the window. How do I go about that?

If you're using LWJGL directly, you can control what happens and see when the window closes using the Display.isCloseRequested() call. You may have to edit the internals of one of the Game classes in order to support user-control of display closing event.