Skip to content

Commit 302c326

Browse files
committed
Exit menuitem now correctly shows confirmation window before closing application.
1 parent b0f3e86 commit 302c326

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/ee/ut/similaritydetector/ui/controllers/MenuBarController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import javafx.scene.control.MenuItem;
99
import javafx.stage.Stage;
1010
import ee.ut.similaritydetector.ui.utils.UserData;
11+
import javafx.stage.WindowEvent;
1112

1213
import static ee.ut.similaritydetector.ui.utils.AlertUtils.showAlert;
1314

@@ -64,7 +65,7 @@ private void initialize() {
6465

6566
@FXML
6667
private void exitMenuItemClicked() {
67-
MainViewController.stage.close();
68+
MainViewController.stage.fireEvent(new WindowEvent(MainViewController.stage, WindowEvent.WINDOW_CLOSE_REQUEST));
6869
}
6970

7071
/**

0 commit comments

Comments
 (0)