« Return to Thread: No TopComponents after LifecycleManager.exit() in ModuleInstall

Re: No TopComponents after LifecycleManager.exit() in ModuleInstall

by Tonny Kohar-2 :: Rate this Message:

Reply to Author | View in Thread

Hi,

On Tue, May 6, 2008 at 8:44 PM, Guido Lütke Wöstmann
<luetkewo@...> wrote:

> Hi,
>
>  I've created a Subclass of ModuleInstall. In that Class
>  I call "LifecycleManager.getDefault().exit()".
>  If I restart my App there are no TopComponents visible
>  and the Window is minimized (see Screenshot).
>  If I run "Windows->Reset Windows" my App will be restored
>  correctly.
>
>  Anybody an Idea how to prevent this behaviour?

This is only a guess.
My guess is because if you exit when the application is not yet
realized on the screen (ie visible), then it will become problem next
time, because the persistence mechanism employed by Netbeans will
serialize/write to disk the windows state during exit, and in this
case it is empty windows (exit before ui realized).

Maybe you could try this workaround (I haven' tried it yet, use at
your own risk), do not call lifecycle.exit() in the
moduleInstall.restored directly but do it inside listener for ui ready
inside the moduleInstall.restored() to make sure the persistence does
not serialize empty windows  eg:
public class YourModuleInstall extends ModuleInstall
pubic void restored() {
    ..... // do your won stuff
    WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
            public void run() {
             LifecycleManager.getDefault().exit();
}
}


Cheers
Tonny Kohar
--
Citra FX Photo Effects
imagine, design, create ...
http://www.kiyut.com

 « Return to Thread: No TopComponents after LifecycleManager.exit() in ModuleInstall