StageStyle and unified toolbars on the Mac
steve at winnall.ch
Wed Feb 22 07:04:52 PST 2012
I'm trying to create a unified toolbar on the Mac using JavaFX 2.1 b13. For those who don't know what that is, there's an example (albeit for Qt) at
(The bottom variant is the unified toolbar).
I've managed this with Swing using Java 1.6. You do it by creating a JFrame with apple.awt.brushMetalLook set to TRUE and adding a transparent JToolBar at the top of the frame. It looks like this (after appropriate styling of the JToolBar and its buttons):
You can then add further content (e.g. in a JPanel with a white background) after the toolbar.
I can't see how to do this with JavaFX. In fact, I suspect it is impossible, because a Stage either has a solid white background or is completely transparent according to StageStyle. Is there any way of suppressing the sold white background? Why does a Stage have to have a white background at all? Shouldn't it just provide the boards (to stick with the theatre metaphor)? The white background belongs to the scene, surely?
Perhaps there's another way of making a unified toolbar?
More information about the openjfx-dev