See what methods the latter has? Most notably one that starts with "add" and ends with "Listener"? It's the closing event that will be triggered just before it is actually closed. Don't forget to set the right default close operation (hint hint hint); the default is no longer the one you want.
The window with the JDesktopPane in it is probably a JFrame and JDialog. My advice basically still holds, only you will use a WindowListener instead of an InternalFrameListener, using the windowClosing event. You still need to set the proper default close operation.
Michael Alan Brown
Joined: Jan 07, 2010
Thanks for all you responses but I still having the problem. Even when I set the close option to do nothing the window still closes and I can not add an internal frame or window listener