I have two windows. The first one is been launched if a property file doesn\'t exist. The second is ( I want it to be) opened if the file already exists OR when the user click t
If you don't want to close the window, you should consume the close request event:
if(prop.getProperty("name") != null || f.exists()) { primaryStage.show(); } else { e.consume(); }