Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8125203

ChoiceBox with no items throws an exception when added to a live scene

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 8
    • javafx
    • None

    Description

      If you simply create a ChoiceBox which has no items and add it to the live scene, then it throws the following stack trace:


      EVERE: javafx.scene.control.PopupControl$CSSBridge loadSkinClass Failed to load skin 'StringProperty [bean: PopupControl$CSSBridge[id=choice-box-popup-menu, styleClass=context-menu], name: skinClassName, value: com.sun.javafx.scene.control.skin.ContextMenuSkin]' for popup control PopupControl$CSSBridge[id=choice-box-popup-menu, styleClass=context-menu]
      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      at java.util.ArrayList.rangeCheck(ArrayList.java:603)
      at java.util.ArrayList.get(ArrayList.java:381)
      at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:63)
      at com.sun.javafx.scene.control.skin.ContextMenuContent.computeInitialSize(ContextMenuContent.java:400)
      at com.sun.javafx.scene.control.skin.ContextMenuContent.<init>(ContextMenuContent.java:131)
      at com.sun.javafx.scene.control.skin.ContextMenuSkin.<init>(ContextMenuSkin.java:72)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:395)
      at javafx.scene.control.PopupControl$CSSBridge.loadSkinClass(PopupControl.java:1213)
      at javafx.scene.control.PopupControl$CSSBridge.access$1300(PopupControl.java:998)
      at javafx.scene.control.PopupControl$CSSBridge$2.invalidated(PopupControl.java:1140)
      at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:106)
      at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:140)
      at com.sun.javafx.css.StyleableStringProperty.set(StyleableStringProperty.java:71)
      at javafx.scene.control.PopupControl$CSSBridge$2.set(PopupControl.java:1117)
      at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:59)
      at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:31)
      at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
      at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:949)
      at javafx.scene.Node.impl_processCSS(Node.java:7691)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1168)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1176)
      at javafx.scene.Node.impl_processCSS(Node.java:7660)
      at javafx.scene.control.PopupControl.recomputeSkinSize(PopupControl.java:855)
      at javafx.scene.control.PopupControl.recalculateMinWidth(PopupControl.java:825)
      at javafx.scene.control.PopupControl.minWidth(PopupControl.java:710)
      at com.sun.javafx.scene.control.skin.ChoiceBoxSkin.computeMinWidth(ChoiceBoxSkin.java:340)
      at javafx.scene.control.Control.computeMinWidth(Control.java:374)
      at javafx.scene.Parent.minWidth(Parent.java:885)
      at javafx.scene.layout.Region.minWidth(Region.java:1118)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1338)
      at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:1526)
      at javafx.scene.layout.Region.computeMaxMinAreaWidth(Region.java:1435)
      at javafx.scene.layout.VBox.computeMinWidth(VBox.java:348)
      at javafx.scene.Parent.minWidth(Parent.java:885)
      at javafx.scene.layout.Region.minWidth(Region.java:1118)
      at javafx.scene.layout.Region.layoutInArea(Region.java:1792)
      at javafx.scene.layout.Region.layoutInArea(Region.java:1768)
      at javafx.scene.layout.Region.layoutInArea(Region.java:1709)
      at javafx.scene.layout.BorderPane.layoutChildren(BorderPane.java:561)
      at javafx.scene.Parent.layout(Parent.java:1012)
      at javafx.scene.Scene.layoutDirtyRoots(Scene.java:521)
      at javafx.scene.Scene.doLayoutPass(Scene.java:492)
      at javafx.scene.Scene.access$3900(Scene.java:176)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2230)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:349)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:521)
      at com.sun.javafx.tk.quantum.QuantumToolkit$11.run(QuantumToolkit.java:374)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)

      Attachments

        Activity

          People

            psomashe Parvathi Somashekar (Inactive)
            rbair Richard Bair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: