This is an educational app for Win10/11. It hosts 2 app windows at all times the app is running (even if minimized).
The app auto-saves the user's work (into XML files) during the app-Quit sequence. To Quit, the user hits the Close button on either window. That triggers the auto-save.
But, the Win OS provides a GUI command down in the Task Bar, a right-click menu tied to the app icon -- Close All Windows.
How does Windows signal to the app that the User wants to close all of the app's windows? It seems that it doesn't bother, and just kills the app.
Are there hooks in Java/Swing to pick off this form of user-Quit from the TaskBar?
Closely related, there are 3 other Win OS actions that indirectly kill an app...Shut Down / Restart / Log Off User. Same question, does Java have an "OS listener" that can pick off the impending forced Quit?