Custom main frame close

I won't close the application if x button was pressed. How is this possible?
Simplify IT business | SIB Visions
https://forum.sibvisions.com/
getLauncher().eventWindowClosing().addListener(this, "doWindowClosing");
getLauncher().dispose();