<html><head>
<style id="css_styles">
blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
a img { border: 0px; }
li[style='text-align: center;'], li[style='text-align: center; '], li[style='text-align: right;'], li[style='text-align: right; '] { list-style-position: inside;}
body { font-family: Helvetica; font-size: 9pt; }
.quote { margin-left: 1em; margin-right: 1em; border-left: 5px #ebebeb solid; padding-left: 0.3em; }
</style>
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>A colleague and I are confused about how our Swing desktop app on Mac should exit.</div><div><br /></div>(Please let me know if there’s a better forum to address this question to?)<div><br /></div><div>In QuitHandler the documentation reads:</div><div><div id="xef3aee0851d14ee09bb8e7a092c81c49"><div><br /></div><div>"Implementors must call either <a href="https://docs.oracle.com/en/java/javase/19/docs/api/java.desktop/java/awt/desktop/QuitResponse.html#cancelQuit()"><code>QuitResponse.cancelQuit()</code></a>,
<a href="https://docs.oracle.com/en/java/javase/19/docs/api/java.desktop/java/awt/desktop/QuitResponse.html#performQuit()"><code>QuitResponse.performQuit()</code></a>, or ensure the application terminates.”</div><div><br /></div><div>… but what if our application processes the <i>request</i> to terminate but does <i>not</i> “ensure the application terminates”?</div><div><br /></div><div>For ex: suppose we initiate a series of user dialogs (“do you want to save your changes?”), but the user clicks “Cancel” to indicate they don’t want to proceed. So we are handling/consuming the quit request responsibly, but technically we haven’t done any of the 3 actions we “must” do.</div><div><br /></div></div></div><div>Is this acceptable? (and if so: should we have a ticket to reword the QuitHandler documentation?)</div><div><br /></div><div>Or if it is not acceptable: what bad side-effects should we know to test for?</div><div><br /></div><div>Regards,</div><div> - Jeremy</div><div></div></body></html>