Checking if JDeskTopPane has an opened Window

Hey, I need to check whenever a user close the DesktopPane if it has an opened window, and if it has, then display a message box... Its quite a simple, but i still dont know how to do it..;)Ice
[214 byte] By [iceboyy1] at [2007-9-26 2:22:04]
# 1

There is a getSelectedFrame() method in JDesktopPane. This should return null if there is no selected frame.Although, this doesn't guarantee that there are no open windows, it's a pretty good indication. Also, you can try getAllFrames() and check the length of the array. You will have to fiddle around with these to get a definitely correct answer. A window that isn't visible will still show up as being in the JDesktopPane, which may not be what you want.

Hope this helps,

m

wywiwyg at 2007-6-29 9:28:10 > top of Java-index,Archived Forums,Swing...