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

Unable to create a custom TableRow with a custom Skin

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Labels:
    • Environment:

      JavaFX 2.0, Vista Business

      Description

      When you try to apply a custom skin to a custom table row the parent Skin TableRowSkin generates an error. The application I am writing needs to be able to drag rows of data between tables which is why a custom row is needed. I have attached a demonstration with complete source code to demonstrate the production of this error. I initially thought my code may be flawed so I posted the issue in the forums but received no response which makes be believe this is likely a JavaFX bug. I am aware that this can be done without a skin but being able to swap the skin for this feature would be useful. Below is the error which is generated.

      Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:168)
      at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:17)
      at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:55)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
      at com.sun.javafx.scene.control.skin.TableRowSkin.initBindings(TableRowSkin.java:90)
      at com.sun.javafx.scene.control.skin.TableRowSkin.<init>(TableRowSkin.java:55)
      at javafxapplication.CustomTableRowSkin.<init>(CustomTableRowSkin.java:15)
      at javafxapplication.CustomTableRow.<init>(CustomTableRow.java:13)
      at javafxapplication.JavaFXApplication.createRow(JavaFXApplication.java:27)
      at javafxapplication.JavaFXApplication$1.call(JavaFXApplication.java:68)
      at javafxapplication.JavaFXApplication$1.call(JavaFXApplication.java:65)
      at com.sun.javafx.scene.control.skin.TableViewSkin.createCell(TableViewSkin.java:437)
      at com.sun.javafx.scene.control.skin.TableViewSkin$1.run(TableViewSkin.java:50)
      at com.sun.javafx.scene.control.skin.TableViewSkin$1.run(TableViewSkin.java:48)
      at com.sun.javafx.scene.control.skin.VirtualFlow.getCell(VirtualFlow.java:1192)
      at com.sun.javafx.scene.control.skin.VirtualFlow.getCellLength(VirtualFlow.java:1218)
      at com.sun.javafx.scene.control.skin.VirtualFlow$3.run(VirtualFlow.java:405)
      at com.sun.javafx.scene.control.skin.VirtualFlow$3.run(VirtualFlow.java:403)
      at com.sun.javafx.scene.control.skin.PositionMapper.computeViewportOffset(PositionMapper.java:112)
      at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:774)
      at javafx.scene.Parent.layout(Parent.java:855)
      at javafx.scene.Parent.layout(Parent.java:862)
      at javafx.scene.Parent.layout(Parent.java:862)
      at javafx.scene.Parent.layout(Parent.java:862)
      at javafx.scene.Scene.doLayoutPass(Scene.java:401)
      at javafx.scene.Scene.preferredSize(Scene.java:969)
      at javafx.scene.Scene.impl_preferredSize(Scene.java:993)
      at javafx.stage.Window.sizeToScene(Window.java:106)
      at javafx.stage.Window$12.invalidated(Window.java:473)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:57)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:108)
      at javafx.stage.Window.setVisible(Window.java:514)
      at javafx.stage.Stage.setVisible(Stage.java:105)
      at javafxapplication.JavaFXApplication.start(JavaFXApplication.java:93)
      at com.sun.javafx.application.LauncherImpl$3.run(LauncherImpl.java:127)
      at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:87)
      at com.sun.javafx.application.PlatformImpl$2.run(PlatformImpl.java:65)
      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$1$1.run(WinApplication.java:49)
      ... 1 more

        Attachments

          Activity

            People

            • Assignee:
              jgiles Jonathan Giles
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: