Thanks Greg!

2010/12/18 Greg Brown <[email protected]>

> You can call DesktopApplicationContext.exit() - that will make sure that
> your application's shutdown() method is called. Calling System.exit() will
> terminate the JVM immediately.
>
> On Dec 17, 2010, at 9:36 PM, Luiz Gustavo wrote:
>
> > Hi,
> >
> > I have a menu item for exiting the application, and I use this action for
> that:
> >
> > Action.getNamedActions().put("exit", new Action() {
> >       @Override
> >       public void perform(Component source) {
> >         for (int i = display.getLength() - 1; i >= 0; i--) {
> >           Window window = (Window) display.get(i);
> >           window.close();
> >         }
> >         System.exit(0);
> >       }
> >     });
> >
> > Is it a good way of doing that or is there another better one, in which I
> don't have to call System.exit(0)?
> >
> >
>
>


-- 
Luiz Gustavo S. de Souza

http://luizgustavoss.wordpress.com
http://luizgustavoss.blogspot.com
http://twitter.com/lugustso

Reply via email to