OS/X GUI applications

Philip Race philip.race at oracle.com
Tue Jan 3 19:10:13 UTC 2023



On 12/28/22 7:11 AM, Michael Hall wrote:
> I was wondering for some reason what version of the Scene Builder application I had. There was no application “About” menu item.
> I noticed one of my own applications did have this but I didn’t remember how.
> I finally noticed on my jpackage options I was still using…
>
> -Dcom.apple.mrj.application.apple.menu.about.name=HalfPipe
>
> Which I assume is enabling the feature.

I don't think so. I'd be surprised if anything later than Apple's JDK 6 
recognised that.

There's a property -Xdock:name
which sets the Application Name and jpackage sets that I think.
its handled in launcher code and passed to AWT code via an 
*implementation private* env. variable.
You can similarly use -Xdock:icon to set the dock icon.

If you specify your own About Handler using the Desktop API then I think 
(expect) these aren't used/needed



>
> I also include…
>
> -Dapple.laf.useScreenMenuBar=true -Dapple.awt.application.name=HalfPipe
>
> I am aware the jdk has replaced or eliminated some of this but I didn’t think still including them would cause any problems and more or less forgot they were there.
>
> Is it the intention to continue supporting any of these old Apple properties? Or are they planned to all be eliminated?

I don't know for sure without a really thorough grep but I suspect the 
latter is history.
The screen bar one persists (unfortunately) because it is so tied into 
Aqua (the only L&F
that supports it) that it wasn't something that fitted into the AWT 
Desktop class.
It'll be hard to get rid of, but that isn't the same a promise it'll 
stay since its clearly not ideal.
>
> I verified java.awt.Desktop does include…
>
> void	setAboutHandler​(AboutHandler aboutHandler)
>
> Which I would assume is the cross platform preferred and supported way of doing this. Although a bit more work to provide your own window.

Yes, but you can do more with it then.
>
> If java.awt,Desktop is still the preferred support encapsulating this platform specific functionality will javaFX at some point provide similar?

Providing an  FX equivalent of java.awt.Desktop is on the to-do list.
> This is possibly not the correct list for this. I suppose I should raise the question on the javaFX list as well as that it would be nice if SceneBuilder did have an ‘about’ menu item to check the version you have installed.

For FX apps .. you really should be asking on the FX list.
Most of the above - actually I suspect ALL of it is not relevant to FX.

-phil.




More information about the client-libs-dev mailing list