3

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:

I'm 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

The controller and everything seems to work, but the resulting window looks like this: JavaFX no border or Titlebar

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

Jacob Lockard
  • 1,195
  • 9
  • 24
rasmus91
  • 3,024
  • 3
  • 20
  • 32
  • 3
    Can you try with `-Djdk.gtk.version=2`? See possibly related [question](https://stackoverflow.com/questions/53333364/drag-and-drop-working-differently-in-java-11-vs-java-8). – José Pereda Nov 19 '18 at 10:07

1 Answers1

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'

rasmus91
  • 3,024
  • 3
  • 20
  • 32