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

Labeled.labelPadding StyleableProperty NPE when setting to default value.

    XMLWordPrintable

Details

    Description

      I am setting the Labeled.labelPadding to its default value doing:
      Object val = styleable.getInitialValue() == null ? null : styleable.getInitialValue().convert(null);
      labeled.impl_cssSet(styleable, val);

      I am getting an NPE. I can't reset this property to its initial value. Any styling removed from the SceneBuilder, will be node reflected.


      WARNING: javafx.scene.Node impl_cssSet Failed to set css [StyleableProperty {owningClass: javafx.scene.control.Labeled, fieldName: labelPadding, property: -fx-label-padding, converter: InsetsConverter, initialValue: '', inherits: false, subProperties: []}]

      java.lang.NullPointerException: cannot set labelPadding to null
      at javafx.scene.control.Labeled$8.invalidated(Labeled.java:371)
      testCheckResetProperties Button start
      testCheckResetProperties Check Box start
      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:88)
      at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:122)
      at javafx.scene.control.Labeled.setLabelPadding(Labeled.java:393)
      at javafx.scene.control.Labeled.impl_cssSet(Labeled.java:597)
      at javafx.scene.Node.impl_cssSet(Node.java:6347)

      Attachments

        Issue Links

          Activity

            People

              dgrieve David Grieve
              jfdenise Jean-Francois Denise (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: