Supporting the Mac OS menubar in JavaFX

Daniel Zwolenski zonski at
Sun Dec 11 17:45:53 PST 2011

> The main information I'm after right now is the implications of the
> decisions we make now with regard to native Mac OS menubar support. From
> where I'm sitting, I can't see anything we will come to regret in 2.2 and
> future releases. The same API can be used in a future Ubuntu scenario, and
> entirely different API will need to be developed for features such as
> system tray support and Windows 7 task list support. I don't get any
> feeling of concern about regretting this general I missing
> anything?

I guess one of my points was that I suspect there is a high chance the *same
API* would likely want to be used for Win7 task list support, a medium
chance it would be used for Windows 7 system tray support, and a medium
chance it would be used for the future Android and iPhone menus. I don't
see anything obvious in your proposal (looking at it from a very high
level), that would stop this though.

I like the idea of Application having a single Menu associated with it for
the application. If a Stage feels the need to customise the Menu items to
be specific to it, it can just get hold of that menu and manipulate the
contents to match it - onBroughtToFront it would add its custom items,
onNoLongerInFront it would remove those items (I don't think we have
z-layer change callbacks on Window yet though?). This same mechanism would
allow menus to change not just on the stage that is visible but on custom
app logic (e.g. a Person is selected show the Person options).

This will probably be controversial but I personally think we will run
ourselves into trouble if we say that this Application menu bar is the one
that appears on the top of a Stage for non-Mac OS systems. The whole
File|Edit|Help menu bar thing is a slowly dying concept on Windows (look at
Chrome, IE, Windows Explorer, MS Office 2008, etc), and in the cases where
it does still exist, the location is not standard between applications.

I personally think that on non-Mac OS's the Application menu is *not* the
traditional top-level Stage menu bar thing. At best it more closely fits
with the right-click Task bar menu and/por the system tray (there's no
other way to have menus available when all the windows are closed). Either
that or it is a concept that just doesn't get mapped to the other OS's with
your original option that it is just totally ignored. For me I don't see it
as a good idea to have JFX show the application menu bar at the top of the
scene on windows, etc.

If people want to add traditional menu bars to their stages they can use
the normal mechanism of adding a MenuBar to the top of their scene's root
(and then define custom CSS to hide it or style it on Mac, etc). I don't
reckon they should do this though - they should look at modern GUIs and do
something more nouveau-contemporary-funk that then works just as well on
Windows as it does on Mac.

My 2 cents, and based on market trends probably worth less than that by it
time it gets to you :)

More information about the openjfx-dev mailing list