openjfx / javafx-gradle-plugin

Gradle plugin that makes it easy to work with JavaFX 11+
https://openjfx.io/
BSD 3-Clause "New" or "Revised" License
347 stars 59 forks source link

Updating from 0.0.14 to 0.1.0 breaks working JavaFX Application #169

Closed danielpeintner closed 2 months ago

danielpeintner commented 2 months ago

I have a JavaFX application that is no longer showing/working properly the window (the controls are missing and do not react) after updating the plugin from 0.0.14 to 0.1.0. The "funny" part is that it works fine for gradle run but it shows those strange effects after creating an executable with gradle jpackage.

To facility testing I created a rather simple dummy project that shows similar artifacts. The project can be found here: https://github.com/danielpeintner/Java11Test/tree/non-modular

with gradle run the app (after launching) looks like this.

image

after gradle jpackage the app (after launching) looks like this.

image

When resizing/moving the window around it looks somewhat correct but the controls behave and look strangely (see for example Tab Headers etc) or buttons are not visible where they should be...

image

I am not entirely sure what causes the problem. What i noticed is that it depends a bit on the modules that are used in JavaFX. modules = ['javafx.base', 'javafx.graphics', 'javafx.controls'] seems to work while modules = ['javafx.controls', 'javafx.swing', 'javafx.fxml', 'javafx.media', 'javafx.web'] causes the strange behavior.

I tried to look into https://github.com/openjfx/javafx-gradle-plugin/pull/154 also but didn't find a solution that works. How can I detect the issue.. since it is difficult to get some output after jpackage.

Any hint/tip is appreciated. Thanks!

Note: it might be similar to https://github.com/openjfx/javafx-gradle-plugin/issues/166 but I don't think so. The app starts fine, no errors or such...

danielpeintner commented 2 months ago

The issue is that badass-runtime-plugin in combination with org.openjfx.javafxplugin v0.1.0 requires having all modules (transitive included) declared as "top-level" modules.

Hence, instead of

modules = ['javafx.controls'] you are required to put modules = ['javafx.base', 'javafx.graphics', 'javafx.controls']

MarceloRuiz commented 2 months ago

Just to confirm, this is not the issue with #166 because all the modules are declared as 'top level' modules.