Skip to content

Commit

Permalink
Add save functionality when window is closed by [X] button.
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Fahim Tajwar committed Feb 20, 2023
1 parent 67b82ba commit dbcd44f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/chad/frontend/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
*/
public class Main extends Application {

private Chad chad;
private static Chad chad;

public static void exit() {
Platform.exit();
Expand All @@ -154,6 +154,12 @@ public void start(Stage stage) {
}
}

@Override
public void stop() throws Exception {
chad.getResponse("bye");
super.stop();
}

public static void main(String[] args) {
Application.launch(Main.class, args);
}
Expand Down

0 comments on commit dbcd44f

Please sign in to comment.