<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="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>On Macs the tray can present black or white icons, depending on the color of the desktop underneath the menubar.</div><div><br /></div><div>For example:<br /><div><br /></div><div><img src="cid:em82f189d9-daf5-41df-8455-8453732743c6@573fd4be.com" border="0" /></div></div><div><br /></div><div><img src="cid:em181f3563-7c90-4e34-9d25-90ace397f75f@573fd4be.com" border="0" /></div><div><br /></div><div>Most icons switch from a black icon to a white icon as needed. A few 3rd party app icons do not switch to a white icon against the black background (for ex: Evernote). And interestingly: Apple’s Airdrop icon (the concentric circles shaped like a sideways pacman) also appears to do the wrong thing too.</div><div><br /></div><div>Is there a way in a Java desktop app to set up a tray icon that can toggle between white and black icons as needed?</div><div><br /></div><div>Obviously we’d love it if this “just worked” without further intervention by inverting our icon, but we’d also be happy if a solution involved adding a PropertyChangeListener somewhere to identify the menubar change and we could update the tray icons ourselves.</div><div><br /></div><div>For ex:</div><div>If I change the highlight/accent color (in “System Preferences -> General”), then 8 UIManager Colors change (including “textHighlight”, “Button.light”, etc.) as of JDK 18. As far as I can tell: there is no similar model to identify when the menubar changes colors.</div><div><br /></div><div>For now we’ve made a work-around by using the Robot class to grab a pixel from the Apple menu icon every few seconds to determine if it’s light or dark.</div><div><br /></div><div>Is there an existing way to resolve this we don’t know about?</div><div><br /></div><div>Or if not: is anyone reading this with “author” status interested in helping write this up as an openjdk bug?</div><div><br /></div><div>Regards,</div><div> - Jeremy</div></body></html>