mkpaz / atlantafx

Modern JavaFX CSS theme collection with additional controls.
https://mkpaz.github.io/atlantafx
MIT License
791 stars 64 forks source link

css warnings when open ComboBox for first time #90

Closed Beengoo closed 1 month ago

Beengoo commented 5 months ago

My program works quite specifically (it uses javaFX-swing) and all javafx content is rendered in swing

The problem is that when the ComboBox instance is first opened, the javafx logger sends a warning that it failed to cast the String class in javafx.scene.paint.Paint and javafx.scene.paint.Color

бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Color (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Color is in unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.combo-box-popup>*.list-view' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Color (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Color is in unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar:vertical' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.increment-button' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Color (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Color is in unnamed module of loader 'app')' while converting value for '-fx-effect' from rule '*.scroll-bar:vertical>*.increment-button>*.increment-arrow' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.increment-button>*.increment-arrow' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.decrement-button' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Color (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Color is in unnamed module of loader 'app')' while converting value for '-fx-effect' from rule '*.scroll-bar:vertical>*.decrement-button>*.decrement-arrow' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.decrement-button>*.decrement-arrow' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar:vertical>*.thumb' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Color (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Color is in unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar:horizontal' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.increment-button' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Color (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Color is in unnamed module of loader 'app')' while converting value for '-fx-effect' from rule '*.scroll-bar:horizontal>*.increment-button>*.increment-arrow' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.increment-button>*.increment-arrow' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.decrement-button' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Color (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Color is in unnamed module of loader 'app')' while converting value for '-fx-effect' from rule '*.scroll-bar:horizontal>*.decrement-button>*.decrement-arrow' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.decrement-button>*.decrement-arrow' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.scroll-bar>*.thumb' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Color (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Color is in unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.list-view>*.virtual-flow>*.corner' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Could not resolve '-fx-text-background-color' while resolving lookups for '-fx-text-fill' from rule '*.list-cell' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.list-cell' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП javafx.scene.CssStyleHelper calculateValue
WARNING: Could not resolve '-fx-text-background-color' while resolving lookups for '-fx-text-fill' from rule '*.list-cell' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
бер. 28, 2024 7:42:19 ПП 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 unnamed module of loader 'app')' while converting value for '-fx-background-color' from rule '*.list-cell' in stylesheet jar:file:/C:/Users/beengoo/.m2/repository/org/openjfx/javafx-controls/21.0.2/javafx-controls-21.0.2-linux.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
Beengoo commented 5 months ago

atlantafx version: 2.0.0 javafx version: 21.0.2 jdk version: 17.0.9

TelKel81 commented 5 months ago

I get same error and am not using Swing. I can't check my code right now but I think it happens when I override updateItem (via setCellFactory)

Beengoo commented 4 months ago

I get same error and am not using Swing. I can't check my code right now but I think it happens when I override updateItem (via setCellFactory)

There is a temporary solution, it is simply to turn off the logger

java.util.logging.LogManager.getLogManager().reset(); // Disable all logs (I'm using log4j so it's not that critical for me)
// Do...
mkpaz commented 1 month ago

Yes, there's something with JavaFX when it loads styles. Here's an another issue https://github.com/mkpaz/atlantafx/issues/65 but with other controls. Unfortunately, there's nothing I can change.