setdefaultcloseoperation doesn't work in griffon

56 views Asked by At
@ArtifactProviderFor(GriffonView.class)

public class MyWindow extends AbstractSwingGriffonView {

    @Override
    public void initUI() {

        final JFrame jframe= (JFrame) getApplication()
            .createApplicationContainer(Collections.<String, Object>emptyMap());

        frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

above window is appeared as expected but when I closed it will close. If there a way I can stop closing ? I wanted to have a confirm dialog but without working do nothing on close I am not able to give option dialog

1

There are 1 answers

0
Andres Almiray On

You can register a custom WindowDisplayHandler or use the WindowManager DSL as explained at http://griffon-framework.org/guide/2.4.0/#_views_windowmanager