Correct. Non-modal dialogs will not block on their setVisible method, so the windowClosing method finishes and the window is closed.
By the way, I'm sorry for the compiler errors in my code; it was just quickly copied from Craig's code and modified a bit; moving code around failed to rename some stuff
And I noticed the dialog does not center around the frame, but a simple call to dialog.setLocationRelativeTo(frame) will do that for you.
If you want to remove the close button etc of the dialog, you can call setUndecorated(true) on it.
You should call this before pack() because it will fail for realized windows. Check the API for more info.
[ October 24, 2008: Message edited by: Rob Prime ]