How to ensure Stage opens as a window and not a tab?

Viewed 97

New stages traditionally opened as new windows.Then MacOS came around and introduced this in (System Preferences -> General): enter image description here

Now all my new JavaFX stages are all opening as new tabs on top of the first opened stage. If I change the system setting, stages once again open as windows. But I prefer to leave the system setting on "always" because its the only way pdfs and other documents will open in tabs. How can I override the system setting in my JavaFX apps and get my old windows back?

2 Answers

As suggested here, a Stage may have a specific StageStyle, Modality and owner. As noted here, StageStyle.UTILITY, "a stage with a solid white background and minimal platform decorations," achieves the desired effect.

stage.initStyle(StageStyle.UTILITY)

New (possible) solution: Upgrade to JavaFX 17+7 or later.

After a few weeks they responded on the email list and integrated a change as can be seen here. I haven't fully tested it myself.

Related