Missing titlebar on javafx app, with OpenJFX

十年热恋 提交于 2020-01-30 12:03:07

问题


I'm currently building an application with OpenJDK 11 and OpenJFX. It compiles just fine, and starts, but there is no titlebar, and if i click close to the edge of the app, it registers as a click on whatever window is behind it.

I am using intelliJ idea, and it took a while to figure out how to even use openjfx with it, anyhow, here's the system details:

running elementary OS 5.0 Juno (based off of Ubuntu 18.04, everything is GTK) IntelliJ Idea (Community) 2018 installed as a snap. OpenJFX sdk downloaded from here: OpenJFX from Gluon

I've just made a new javaFX app, and added the dir /javafx-sdk-11.0.1/lib/ to external libraries, and then went to run -> edit configurations and added vm options --module-path <path>/javafx-sdk-11.0.1/lib --add-modules=javafx.controls,javafx.fxml,javafx.base

controller and everything seems to work, but the resulting window looks like this:

Does someone know just what i'm doing wrong here?


回答1:


Thanks to José Pereda

It was exactly that which fixed it. See the question he linked for details: problems with gtk3 and javafx

Anyhow, in intelliJ it's solved by going to Run -> Configurations and adding -Djdk.gtk.version=2 to the 'VM Options'



来源:https://stackoverflow.com/questions/53372200/missing-titlebar-on-javafx-app-with-openjfx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!