Java interop with Windows window elements

While editing a list of choices in a Java app, how does one trap the user's pressing of the Windows X button so that one can prompt the user to save their edits prior to dumping them as the Window closes?
[212 byte] By [Gregory_Popea] at [2007-10-2 3:57:57]
# 1
never tried this myself but wouldn't you use a windowListener to kick off a "do you want to save your changes before you quit" window?[url= http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/WindowListener.html]look at windowClosing[/url]
Briganda at 2007-7-15 23:19:35 > top of Java-index,Java Essentials,Java Programming...
# 2
Hmmm, isn't this the same Gregory_Pope who played the know-it-all fool recently, posting a bunch of pompous answers (which were mostly if not all incorrect)? Unfortunately, the posts were deleted.
warnerjaa at 2007-7-15 23:19:35 > top of Java-index,Java Essentials,Java Programming...
# 3
> Unfortunately, the posts were deleted.The real "sheriff" is someone from Sun, who are deleting replies without any justification!LOL!!!Sun, you disgust me more and more...
Marcelo9a at 2007-7-15 23:19:35 > top of Java-index,Java Essentials,Java Programming...