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

MenuItemContainer.computePrefHeight gets IndexOutOfBonds and gives an empty window

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 8
    • javafx

      Hi,

      I'm currently testing JavaFX 8, and i sometimes (every 1 in 5/6 launches, i'd say) get this bug. I don't think it comes from my gui code, since i'm currently working on some db stuff/it's kept to a minimal state, though i'm far from an experienced developper.

      The Javafx window shows up, but with a pale yellow background and a small grey rectangle in the upper left corner.

      The error :

      :run
      Using Modena Theme
      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:87)
              at com.sun.javafx.collections.VetoableListDecorator.get(VetoableListDecorator.java:247)
              at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.computePrefHeight(ContextMenuContent.java:1332)
              at javafx.scene.Parent.prefHeight(Parent.java:864)
              at javafx.scene.layout.Region.prefHeight(Region.java:1183)
              at com.sun.javafx.scene.control.skin.ContextMenuContent.getContentHeight(ContextMenuContent.java:352)
              at com.sun.javafx.scene.control.skin.ContextMenuContent.computePrefHeight(ContextMenuContent.java:322)
              at javafx.scene.Parent.prefHeight(Parent.java:864)
              at javafx.scene.layout.Region.prefHeight(Region.java:1183)
              at javafx.scene.Node.autosize(Node.java:2716)
              at javafx.scene.Parent.layoutChildren(Parent.java:1032)
              at javafx.scene.Group.layoutChildren(Group.java:192)
              at javafx.scene.Parent.layout(Parent.java:1003)
              at javafx.scene.Parent.layout(Parent.java:1011)
              at javafx.scene.Scene.layoutDirtyRoots(Scene.java:576)
              at javafx.scene.Scene.doLayoutPass(Scene.java:547)
              at javafx.scene.Scene.access$3800(Scene.java:183)
              at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2250)
              at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:351)
              at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:561)
              at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:540)
              at com.sun.javafx.tk.quantum.QuantumToolkit$15.run(QuantumToolkit.java:425)
              at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:94)
              at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
              at com.sun.glass.ui.gtk.GtkApplication.access$200(GtkApplication.java:48)
              at com.sun.glass.ui.gtk.GtkApplication$5$1.run(GtkApplication.java:138)
              at java.lang.Thread.run(Thread.java:722)

      My gui code :

        Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA)

        val tabPane = new TabPane()
        val tab1 = new Tab()
        val tab2 = new Tab()
        tab1.setText("new tab")
        tab2.setContent(new Rectangle(200,200, Color.LIGHTSTEELBLUE))
        tabPane.getTabs.addAll(tab1, tab2)

        val toolBar = new ToolBar(
          new Button("New"),
          new Button("Open"),
          new Button("Save"),
          new Separator(),
          new Button("Clean"),
          new Button("Compile"),
          new Button("Run"),
          new Separator(),
          new Button("Debug"),
          new Button("Profile")
        )
        toolBar.setOrientation(Orientation.VERTICAL)
        tab1.setContent(toolBar)

        val scene = new Scene(tabPane, 800, 600, Color.BEIGE)


      Sorry if i'm unclear/at the wrong place. I'm not sure for example if Javafx 8.0.0-ea-b81 is lombard ?

            psomashe Parvathi Somashekar (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: