edvin / tornadofx2

TornadoFX 2.0
Apache License 2.0
154 stars 40 forks source link

Runtime error while importing tornadofx styles #34

Open SchweinchenFuntik opened 3 years ago

SchweinchenFuntik commented 3 years ago

kotlin: 1.4.32 JavaFX: 11, 15 JDK: Liberica TornadoFX 2

object Styles : Stylesheet() {
    init {

        defaultColor0 {
            chartAreaSymbol
            chartLineSymbol {
                backgroundColor = multi(Color.GREEN)
            }
        }
    }
}

class AnalyticsView : View() {
    init {
        importStylesheet(Styles::class)
    }
lang.IllegalAccessException: class sun.net.www.protocol.css.Handler$CSSURLConnection cannot access a member of class package.Styles with modifiers "private"
    at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385)
    at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:693)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:490)
    at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
    at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:350)
    at java.base/java.lang.Class.newInstance(Class.java:645)
    at sun.net.www.protocol.css.Handler$CSSURLConnection.getInputStream(Handler.kt:20)
    at java.base/java.net.URL.openStream(URL.java:1167)
    at javafx.graphics/javafx.css.CssParser.parse(CssParser.java:235)
    at javafx.graphics/com.sun.javafx.css.StyleManager.loadStylesheetUnPrivileged(StyleManager.java:1117)
    at javafx.graphics/com.sun.javafx.css.StyleManager.loadStylesheet(StyleManager.java:943)
    at javafx.graphics/com.sun.javafx.css.StyleManager.processStylesheets(StyleManager.java:1552)
    at javafx.graphics/com.sun.javafx.css.StyleManager.gatherSceneStylesheets(StyleManager.java:1610)
    at javafx.graphics/com.sun.javafx.css.StyleManager.findMatchingStyles(StyleManager.java:1646)
    at javafx.graphics/javafx.scene.CssStyleHelper.createStyleHelper(CssStyleHelper.java:112)
    at javafx.graphics/javafx.scene.Node.reapplyCss(Node.java:9471)
    at javafx.graphics/javafx.scene.Node.reapplyCSS(Node.java:9434)
    at javafx.graphics/javafx.scene.Node.invalidatedScenes(Node.java:1095)
    at javafx.graphics/javafx.scene.Node.setScenes(Node.java:1160)
    at javafx.graphics/javafx.scene.Parent.scenesChanged(Parent.java:772)
    at javafx.graphics/javafx.scene.Node.invalidatedScenes(Node.java:1073)
    at javafx.graphics/javafx.scene.Node.setScenes(Node.java:1160)