Adding embedded events to awt ApplicationDelegate on MacOS

Paul Hayder p.hayder at altimate.de
Fri Mar 28 16:27:34 UTC 2025


Dear developers,

I am currently fixing a bug on the JavaFX side which also affects the JDK (for details: https://bugs.openjdk.org/browse/JDK-8332947).
I need to handle openURL events for a MacOS native Java application, while also using the native menu bar from within JavaFX. 
The main issue is that for opening an URL, I rely on AWT. 
Now I have the problem when firstly registering the openURL event handler with AWT, JavaFX will run embedded and won’t register the native menu.
But if I firstly initialize JavaFX, AWT won’t receive the openURL events as it is running embedded and won’t register the appropriate app delegate.

My proposal is to add a notification listener to the Notification Center that listens for events if running embedded (for the implementation: https://github.com/pabulaner/jdk/tree/embedded-event).
Those events can be used to forward events not handled by other applications (like JavaFX and openURL) to AWT to handle them on their behalf.
This would allow JavaFX to call the AWT openURL method without adding a direct dependency to it and would allow AWT to receive events, even if it runs embedded and only if the application desires it.

Please let me know what Your feedback is on that proposal and the concrete implementation.

Best Regards
Paul Hayder

Github: https://github.com/pabulaner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20250328/fc546fe1/attachment-0001.htm>


More information about the jdk-dev mailing list