<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 16, 2023, at 10:33 PM, Scott Palmer <<a href="mailto:swpalmer@gmail.com" class="">swpalmer@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class="">There are third-party libraries for better integration with the Mac menu bar.<div class=""><br class=""></div><div class="">E.g. <a href="https://github.com/codecentric/NSMenuFX" class="">https://github.com/codecentric/NSMenuFX</a></div><div class=""><br class=""></div><div class="">Though I wish this wasn’t necessary and proper hooks were present in JavaFX to begin with.<br class=""><br class=""></div></div></div></blockquote><br class=""></div><div>That does look like it provides the About menu item. In looking at this I didn’t determine why JavaFX app’s don’t get the default ‘Cocoa’ one Swing app’s do (free of charge, no need for java.awt.Desktop or any app changes at all). This should just work. If the changes I provided in the bug report were used you would get this by simply including…</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>static {<br class=""><span class="Apple-tab-span" style="white-space:pre">               </span>//java.awt.Toolkit.getDefaultToolkit(); // Start AppKit<br class=""><span class="Apple-tab-span" style="white-space:pre">                </span>Thread t = new Thread(() -> { java.awt.Toolkit.getDefaultToolkit(); });<br class="">      <span class="Apple-tab-span" style="white-space:pre">   </span>t.start();  <br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><br class=""></div><div>The thread change seemed necessary to hit ApplicationDelegate with access to the menubar. I don’t know yet if it will be considered in the scope of the bug fix to determine why the code doesn’t work as-is and eliminate the need for this.</div><div><br class=""></div><div>I think originally the setAboutHandler and other functionalities of java.awt.Desktop were the jdk’s attempt to get rid of the equivalent Apple API’s as a sort of 3rd party add on. I wondered if it might not be more generally useful for JavaFX to have full access to java.awt.Desktop. I did go so far as to verify that with the following…</div><div><br class=""></div><div>public class HelloWorld extends Application implements AboutHandler {</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">  </span>@Override<br class=""><span class="Apple-tab-span" style="white-space:pre">      </span>public void init() {<br class="">    <span class="Apple-tab-span" style="white-space:pre">        </span>Thread t = new Thread(() -> {<br class=""><span class="Apple-tab-span" style="white-space:pre">                       </span>Desktop desktop = Desktop.getDesktop();<br class=""><span class="Apple-tab-span" style="white-space:pre">                        </span>desktop.setAboutHandler((AboutHandler)this);   <br class=""><span class="Apple-tab-span" style="white-space:pre">              </span>});<br class=""><span class="Apple-tab-span" style="white-space:pre">            </span>t.start();<span class="Apple-tab-span" style="white-space:pre">          </span>  <span class="Apple-tab-span" style="white-space:pre">                                </span><br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>}</div><div><br class=""></div><div>    public void handleAbout(AboutEvent evt) {<br class="">    <span class="Apple-tab-span" style="white-space:pre"> </span>System.out.println("got to handleAbout");<br class="">    <span class="Apple-tab-span" style="white-space:pre"> </span>Platform.runLater(() -> {<br class="">    <span class="Apple-tab-span" style="white-space:pre">                </span>Alert alert = new Alert(AlertType.INFORMATION, "About HelloWorld");<br class=""><span class="Apple-tab-span" style="white-space:pre">                  </span>alert.showAndWait();<br class=""><span class="Apple-tab-span" style="white-space:pre">           </span>});<br class="">    }</div><div><br class=""></div><div>Again, the thread changes seemed necessary. </div><div>I don’t make much other use of java.awt.Desktop anywhere myself. But possibly other JavaFX developers would find some of it’s functionality useful or necessary. So I think long term some determination might need to made if JavaFX will develop all of this themselves. Or, use of java.awt.Desktop can continue to be used. Whether any attempt to address that will be made in resolving the bug report I don’t know. From the jdk side they could possibly figure out some way to provide this without some of the Thread changes. Or indicate if any support for java.awt.Desktop for JavaFX applications will be made at all.</div><br class=""></body></html>