If you have a test program, can you file it here?
https://bugreport.java.com/
Thanks.
-- Kevin
On 6/8/2021 2:12 PM, Duquette, Will (US 397J) wrote:
The problem arises when I switch out the stylesheet for an active GUI, with
code like this:
root.getStylesheets().clear()
root.getStylesheets().add(styleSheetURL)
It's the clear() that's the problem. If add the new stylesheet and then remove
the old one, no messages are produced.
I have a simple test program, if you'd like to have this submitted to a bug
tracker.
Will Duquette
On 6/8/21, 1:33 PM, "openjfx-dev on behalf of Duquette, Will (US 397J)"
<[email protected] on behalf of [email protected]> wrote:
Howdy!
I'm migrating a code-base from JavaFX 8 to JavaFX 11, and I'm seeing some
weird behavior. I have some CSS that looks like this (in part)
.root {
-theme-button: #0679DE;
}
.button-primary {
-fx-background-color: -theme-button;
}
It's been working great in JavaFX 8 for quite a long while. When I load
the same app, I get messages like this written to the console.
Jun 08, 2021 10:40:07 AM javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String
cannot be cast to class javafx.scene.paint.Paint (java.lang.String is in module
java.base of loader 'bootstrap'; javafx.scene.paint.Paint is in module
[email protected] of loader 'platform')' while converting value for
'-fx-background-color' from rule '*.button-primary' in stylesheet
file:/Users/will/github/dgs-tool/out/production/dgs-lib/dsn-dark.css
Surprisingly, the color seems to still get set—but warnings written to the
console are worrying.
If I replace -theme-button with #0679DE in the .button-primary style, the
message goes away.
I'm seeing this for -fx-background-color and -fx-border-color, but not for
any other places where I use looked-up colors.
Any ideas?