This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Custom main frame close

General questions regarding the development with JVx.

Custom main frame close

Postby jvxdev » Fri Mar 04, 2016 4:43 pm

I won't close the application if x button was pressed. How is this possible?
jvxdev
 
Posts: 19
Joined: Fri Mar 04, 2016 12:40 pm

Re: Custom main frame close

Postby Support@SIB » Fri Mar 04, 2016 4:47 pm

This depends on the UI implementation.

If you use Vaadin UI, it can't be done because JVx can't change the browser handling.
If you use Swing UI, it's easy because the launcher is the frame:

Code: Select all
getLauncher().eventWindowClosing().addListener(this, "doWindowClosing");

If you add a listener to the event, the default implementation will be completely ignored.

Don't forget to call:

Code: Select all
getLauncher().dispose();

in your listener, to close the frame, if needed.
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm


Return to Development