Re: How to override the Netbeans Platform (x) button or the netbeans platform default close operation
Steven Yi <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <CANtcCs6J=H7mSuhAvjG+jfpWF_NPWx65HNwSpNFGEu6rKexsUg@mail.gmail.com> |
Hi Jason, I use the closing() method in a ModuleInstall and have not had any problems. In my closing() method, I run some utility code to show dialogs to confirm saving of files by the user. The utility code returns a boolean to signal whether exit should occur and that gets returned from the closing() method. However, I do wonder, are you by chance on OSX and using a custom look and feel, or installing your own event handlers for things like "About" or "Quit"? I seem to remember some experiences on OSX where using the default look and feel for NB RCP would have all OSX event handlers installed correctly, but any customization might undo what the RCP gives. (I could well be remembering this incorrectly though...) Perhaps it would help if you mentioned what OS you are seeing this on, and what version of NetBeans Platform you are using? steven On Fri, Sep 30, 2016 at 11:40 AM, JasonVanBiezen <[email protected]> wrote: > Hello everyone, I've been using NetBeans Platform for a little while now and I've run into a problem of handling unsaved changes when the (x) button in the upper right hand corner is clicked to exit the app. > > I've tried adding WindowAdapters to the WindowStateListener and WindowListener, as well as overriding the installers closing() method but the app still just exits immediately. :? > > What is the proper method for overriding a Netbeans Platform app's default exit behavior? > > Thanks! :) > > > >