简体   繁体   中英

JavaFX system MenuBar disappears when the window is being minimized on Mac

I'd like to create a JavaFX application with MenuBar and I want my application to look more native-like, so I set useSystemMenuBarProperty to true. The application looks normal, like this (just ignore IntelliJ IDEA at background):

在此处输入图片说明

This is cool, and it works as it should. But when I minimize my application to the dock, the menubar starts to look like this:

在此处输入图片说明

As you can see, all buttons were disappeared, which is kinda strange.

The question is : How can I fix this? What do I have to do to make it look normal? Thanks.

This is indeed a strange problem which I actually haven't noticed before and I have no idea how to fix this. You should probably report this as a bug. At least the vanished part of the menu reappears when the window is made visible again, so this does not seem to be too serious, although it differes from the normal behaviour.

If you want to make your application even more native-like you should also have a look at https://github.com/codecentric/NSMenuFX which provides some additional features which are not present in JavaFX alone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM