following test snippet fails with IllegalStateException:
@Test
public void testSpinnerSkin() {
Spinner<?> spinner = new Spinner<>();
spinner.setSkin(new SpinnerSkin<>(spinner));
spinner.setSkin(new SpinnerSkin<>(spinner));
}
Exception:
java.lang.IllegalArgumentException: Children: duplicate children added: parent = Spinner@2b40ff9c[styleClass=spinner]
at javafx.graphics/javafx.scene.Parent$3.onProposedChange(Parent.java:560)
at javafx.base/com.sun.javafx.collections.VetoableListDecorator.add(VetoableListDecorator.java:206)
at javafx.controls/javafx.scene.control.skin.SpinnerSkin.<init>(SpinnerSkin.java:112)
at javafx.controls/test.javafx.scene.control.skin.SkinIssuesTest.testSpinnerSkin(SkinIssuesTest.java:92)
turned up working onJDK-8244531
don't quite understand why it is a problem here but not in ComboXX (which may or may not have an editor) - they also have editors, any ideas?
NOTE: the fix requires both ListenerHelperJDK-8294809 and Skin.install() JDK-8290844 changes.
@Test
public void testSpinnerSkin() {
Spinner<?> spinner = new Spinner<>();
spinner.setSkin(new SpinnerSkin<>(spinner));
spinner.setSkin(new SpinnerSkin<>(spinner));
}
Exception:
java.lang.IllegalArgumentException: Children: duplicate children added: parent = Spinner@2b40ff9c[styleClass=spinner]
at javafx.graphics/javafx.scene.Parent$3.onProposedChange(Parent.java:560)
at javafx.base/com.sun.javafx.collections.VetoableListDecorator.add(VetoableListDecorator.java:206)
at javafx.controls/javafx.scene.control.skin.SpinnerSkin.<init>(SpinnerSkin.java:112)
at javafx.controls/test.javafx.scene.control.skin.SkinIssuesTest.testSpinnerSkin(SkinIssuesTest.java:92)
turned up working on
don't quite understand why it is a problem here but not in ComboXX (which may or may not have an editor) - they also have editors, any ideas?
NOTE: the fix requires both ListenerHelper
- blocks
-
JDK-8241364 ☂ Cleanup skin implementations to allow switching
- Open
- relates to
-
JDK-8294809 ListenerHelper for managing and disconnecting listeners
- Resolved
-
JDK-8290844 Add Skin.install() method
- Resolved