Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with #124

Closed
ThomasDaheim opened this issue Jan 5, 2021 · 7 comments
Closed

Exception with #124

ThomasDaheim opened this issue Jan 5, 2021 · 7 comments

Comments

@ThomasDaheim
Copy link

Hi,

when using he CalendarTextField from 14-r1 (not sure about other versions...) I get below exception when opening the calendar of the CalendarTextField.

There might be an interaction with JMetro that I'm using as well - will open an issue on their side as well...

Thanks,
Thomas

Jan. 05, 2021 8:47:21 PM javafx.scene.control.Control loadSkinClass
SCHWERWIEGEND: Failed to load skin 'impl.jfxtras.labs.internal.scene.control.skin.ListSpinnerCaspianSkin' for control ListSpinner[id=yearListSpinner, styleClass=ListSpinner ListSpinnerSkin]
java.lang.ClassNotFoundException: impl.jfxtras.labs.internal.scene.control.skin.ListSpinnerCaspianSkin
	at java.base/java.lang.Class.forNameImpl(Native Method)
	at java.base/java.lang.Class.forName(Class.java:417)
	at javafx.controls/javafx.scene.control.Control.loadClass(Control.java:124)
	at javafx.controls/javafx.scene.control.Control.loadSkinClass(Control.java:720)
	at javafx.controls/javafx.scene.control.Control$5.invalidated(Control.java:680)
	at javafx.base/javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:110)
	at javafx.base/javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:145)
	at javafx.graphics/javafx.css.StyleableStringProperty.set(StyleableStringProperty.java:83)
	at javafx.controls/javafx.scene.control.Control$5.set(Control.java:672)
	at javafx.graphics/javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:69)
	at javafx.graphics/javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:45)
	at javafx.graphics/javafx.scene.CssStyleHelper.transitionToState(CssStyleHelper.java:790)
	at javafx.graphics/javafx.scene.Node.doProcessCSS(Node.java:9662)
	at javafx.graphics/javafx.scene.Node$1.doProcessCSS(Node.java:472)
	at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSSImpl(NodeHelper.java:192)
	at javafx.graphics/com.sun.javafx.scene.ParentHelper.superProcessCSSImpl(ParentHelper.java:93)
	at javafx.graphics/com.sun.javafx.scene.ParentHelper.superProcessCSS(ParentHelper.java:63)
	at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1369)
	at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125)
	at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
	at javafx.controls/com.sun.javafx.scene.control.ControlHelper.superProcessCSSImpl(ControlHelper.java:63)
	at javafx.controls/com.sun.javafx.scene.control.ControlHelper.superProcessCSS(ControlHelper.java:55)
	at javafx.controls/javafx.scene.control.Control.doProcessCSS(Control.java:900)
	at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Control.java:89)
	at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(ControlHelper.java:67)
	at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145)
	at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400)
	at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125)
	at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
	at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145)
	at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400)
	at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125)
	at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
	at javafx.controls/com.sun.javafx.scene.control.ControlHelper.superProcessCSSImpl(ControlHelper.java:63)
	at javafx.controls/com.sun.javafx.scene.control.ControlHelper.superProcessCSS(ControlHelper.java:55)
	at javafx.controls/javafx.scene.control.Control.doProcessCSS(Control.java:900)
	at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Control.java:89)
	at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(ControlHelper.java:67)
	at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145)
	at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400)
	at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125)
	at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
	at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145)
	at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400)
	at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125)
	at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
	at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145)
	at javafx.graphics/javafx.scene.Node.processCSS(Node.java:9544)
	at javafx.graphics/javafx.scene.Scene.doCSSPass(Scene.java:569)
	at javafx.graphics/javafx.scene.Scene.preferredSize(Scene.java:1747)
	at javafx.graphics/javafx.scene.Scene$2.preferredSize(Scene.java:393)
	at javafx.graphics/com.sun.javafx.scene.SceneHelper.preferredSize(SceneHelper.java:66)
	at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1086)
	at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
	at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
	at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1174)
	at javafx.graphics/javafx.stage.Window.show(Window.java:1189)
	at javafx.graphics/javafx.stage.PopupWindow.showImpl(PopupWindow.java:472)
	at javafx.graphics/javafx.stage.PopupWindow.show(PopupWindow.java:417)
	at jfxtras.internal.scene.control.skin.CalendarTextFieldSkin.showPopup(CalendarTextFieldSkin.java:475)
	at jfxtras.internal.scene.control.skin.CalendarTextFieldSkin.lambda$construct$2(CalendarTextFieldSkin.java:108)
	at jfxtras.internal.scene.control.skin.CalendarTextFieldSkin$$Lambda$1358/00000000198827B0.changed(Unknown Source)
	at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
	at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.base/javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:104)
	at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
	at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
	at jfxtras.scene.control.CalendarTextField.setPickerShowing(CalendarTextField.java:306)
	at jfxtras.internal.scene.control.skin.CalendarTextFieldSkin.lambda$createNodes$7(CalendarTextFieldSkin.java:209)
	at jfxtras.internal.scene.control.skin.CalendarTextFieldSkin$$Lambda$1354/000000001B150170.handle(Unknown Source)
	at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics/javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3563)
	at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3865)
	at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1851)
	at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:704)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$1004/0000000000000000.get(Unknown Source)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
	at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
	at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
	at com.sun.glass.ui.win.WinApplication$$Lambda$98/0000000000000000.run(Unknown Source)
	at java.base/java.lang.Thread.run(Thread.java:835)
@tbee
Copy link
Member

tbee commented Jan 5, 2021 via email

@ThomasDaheim
Copy link
Author

Just tried it without JMetro and I don't get an exception in that case. Will try tomorrow if I can reproduce with a more simple UI since in my current case there is also ControlsFX and other stuff involved. Anything else I could play around with?

@tbee
Copy link
Member

tbee commented Jan 6, 2021

You could unpack all the jars and grep for that class in the class and css files. I expect a CSS to define that somewhere and then you know the culprit.

@ThomasDaheim
Copy link
Author

That will be a short search :-) Below minimal example only using

compile group: 'org.jfxtras', name: 'jfxtras-controls', version: '14-r1'
compile group: 'org.jfxtras', name: 'jmetro', version: '11.6.14'

already fails:

public class CalendarTextFieldTest extends Application {
    /**
     * 
     * @param primaryStage 
     */
    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("CalendarTextField Test");
       
        final CalendarTextField calendarTextField = new CalendarTextField();
        calendarTextField.setAllowNull(true);
        calendarTextField.setShowTime(true);
        calendarTextField.setDateFormat(new SimpleDateFormat("dd.MM.uuuu HH:mm:ss"));
        
        final StackPane stackPane = new StackPane();
        stackPane.getChildren().add(calendarTextField);
        
        final Scene scene = new Scene(stackPane);
        primaryStage.setScene(scene);
        (new JMetro(Style.LIGHT)).setScene(primaryStage.getScene());
        
        primaryStage.show();
    }
}

@ThomasDaheim
Copy link
Author

Found it! jmetro-11.6.14\jfxtras\styles\jmetro\base_other_libraries.css, Line 40:

.ListSpinner {
    -fx-skin: "impl.jfxtras.labs.internal.scene.control.skin.ListSpinnerCaspianSkin";
    -fx-background-color: #f0f0f0;
    -fx-background-insets: 0 0 0 0;
    -fx-background-radius: 0;
    -fx-padding: 0.266667em 0.233333em 0.25em 0.233333em;
    -fx-text-fill: #212121;
}

@ThomasDaheim
Copy link
Author

And the patch is straight forward... Will let Pedro know about this.

.ListSpinner {
    /*-fx-skin: "impl.jfxtras.labs.internal.scene.control.skin.ListSpinnerCaspianSkin";*/
    -fx-skin: "jfxtras.internal.scene.control.skin.ListSpinnerSkin";
    -fx-background-color: #f0f0f0;
    -fx-background-insets: 0 0 0 0;
    -fx-background-radius: 0;
    -fx-padding: 0.266667em 0.233333em 0.25em 0.233333em;
    -fx-text-fill: #212121;
}

@tbee
Copy link
Member

tbee commented Jan 6, 2021

As expected :-) I've been battling the test side of the JPMS migration for so long now, that the code base itself has been untouched for ages, and such problems should have surfaced already. Enjoy the library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants