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

Adding Nodes to the TableRowSkin causes class cast runtime exception when sorting on the column header

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • fx2.1
    • fx2.0.1
    • javafx
    • Win 7 64 / JavaFX 2.0 (64) / JDK 7 (64) / NetBeans 7.1 Beta

    Description

      Attempting to add a Rectangle to the bottom of a sub-classed TableRow for purposes of vertically resizing the TableRow. In order to accopmlish this - I couldn't add Nodes to the TableRow directly but had to add the Rectangle Node to the TableRowSkin instance for the TableRow. All works well - except when clicking on the Column Header t sort the column. The following exception occurs:

      java.lang.ClassCastException: javafx.scene.shape.Rectangle cannot be cast to javafx.scene.control.TableCell
      at com.sun.javafx.scene.control.skin.TableRowSkin.handleControlPropertyChanged(TableRowSkin.java:91)
      at com.sun.javafx.scene.control.skin.SkinBase$4.changed(SkinBase.java:242)
      at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:67)
      at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:64)
      at javafx.beans.property.ReadOnlyObjectWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyObjectWrapper.java:154)
      at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:120)
      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:89)
      at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:122)
      at javafx.scene.control.TableRow.setTableView(TableRow.java:117)
      at javafx.scene.control.TableRow.updateTableView(TableRow.java:294)
      at com.sun.javafx.scene.control.skin.TableViewSkin.updateRowCount(TableViewSkin.java:598)
      at com.sun.javafx.scene.control.skin.TableViewSkin.layoutChildren(TableViewSkin.java:397)
      at javafx.scene.Parent.layout(Parent.java:900)
      at javafx.scene.Parent.layout(Parent.java:910)
      at javafx.scene.Parent.layout(Parent.java:910)
      at javafx.scene.Scene.layoutDirtyRoots(Scene.java:451)
      at javafx.scene.Scene.doLayoutPass(Scene.java:424)
      at javafx.scene.Scene.access$2800(Scene.java:132)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:1750)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:292)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:398)
      at com.sun.javafx.tk.quantum.QuantumToolkit$10.run(QuantumToolkit.java:330)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
      at java.lang.Thread.run(Thread.java:722)

      Self Contained exe File Source Code attached

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: