Re: How to override the Netbeans Platform (x) button or the netbeans platform default close operation

Wade Chandler <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CALiWaWknAnRL91_-dUmL7ggSw2ipAj9Yw0+BfBNjDBgm3AqN1w@mail.gmail.com>
I notice you mentioned window listeners. You don't happen to shut down the
JVM outside the LifecycleManager or RCP do you? That could cause some
oddities for sure. What did your closing implementation look like? I
suggest making the simplest example of a platform app using closing and how
you want it to work and see how that works, and if not working, make it
something you can share on GitHub or Bitbucket to get help.

You can also see this:
http://bits.netbeans.org/8.1/javadoc/org-openide-modules/org/openide/modules/OnStop.html

Where the callables ask if it is OK, and the runnables allow you to cleanup
if you allow the shutdown.

If you are questioning the user, you need to be sure you are using some
synchronous question ... Modal Dialog ... Or block some other way ... Like
invokeAndWait ...To return your answer. If you don't do that, then you may
not be returning when you think you are; just being sure.

Wade

On Sep 30, 2016 12:30 PM, "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!    :)
>
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.