Page 1 of 1

Custom main frame close

PostPosted: Fri Mar 04, 2016 4:43 pm
by jvxdev
I won't close the application if x button was pressed. How is this possible?

Re: Custom main frame close

PostPosted: Fri Mar 04, 2016 4:47 pm
by Support@SIB
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.