[CLIENT] #18 : Le soft se ferme désormais complêtement lorsque la croix rouge est utilisée. Amélioration du comportement de fermeture (prise en compte des ImplicitExit)

This commit is contained in:
Notmoo-PC\Notmoo 2018-01-25 16:45:27 +01:00
parent 83bddcd2aa
commit f521c48d22

View File

@ -2,6 +2,7 @@ package com.pqt.client;
import com.pqt.client.gui.FrameManager; import com.pqt.client.gui.FrameManager;
import javafx.application.Application; import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage; import javafx.stage.Stage;
public class Main extends Application{ public class Main extends Application{
@ -10,12 +11,20 @@ public class Main extends Application{
launch(args); launch(args);
} }
@Override private FrameManager fm;
public void start(Stage primaryStage) throws Exception {
FrameManager fm = new FrameManager(primaryStage);
primaryStage.setOnCloseRequest(event->fm.onCloseEvent()); @Override
public void start(Stage primaryStage) {
fm = new FrameManager(primaryStage);
primaryStage.setOnCloseRequest(event-> Platform.exit());
fm.show(); fm.show();
} }
@Override
public void stop(){
if(fm!=null)
fm.onCloseEvent();
}
} }