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

NullPointerException in TextArea, when textProperty is bound

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 7u6
    • fx2.1
    • javafx
    • Windows 7, beta 2.1 b13

      When I bind the textProperty of a TextArea I get a NullPointerException.

      Affects beta 2.1 b13


      Stacktrace:

      SEVERE: javafx.scene.control.Control loadSkinClass Failed to load skin 'StringProperty [bean: TextArea[id=null, styleClass=text-input text-area], name: skinClassName, value: com.sun.javafx.scene.control.skin.TextAreaSkin]' for control TextArea[id=null, styleClass=text-input text-area]
      java.lang.NullPointerException
      at com.sun.javafx.scene.control.skin.TextAreaSkin.<init>(Unknown Source)
      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:525)
      at javafx.scene.control.Control.loadSkinClass(Unknown Source)
      at javafx.scene.control.Control.access$500(Unknown Source)
      at javafx.scene.control.Control$12.invalidated(Unknown Source)
      at javafx.beans.property.StringPropertyBase.markInvalid(Unknown Source)
      at javafx.beans.property.StringPropertyBase.set(Unknown Source)
      at com.sun.javafx.css.StyleableStringProperty.set(Unknown Source)
      at javafx.scene.control.Control$12.set(Unknown Source)
      at com.sun.javafx.css.StyleableStringProperty.applyStyle(Unknown Source)
      at com.sun.javafx.css.StyleableStringProperty.applyStyle(Unknown Source)
      at com.sun.javafx.css.StyleableProperty.set(Unknown Source)
      at com.sun.javafx.css.StyleHelper.transitionToState(Unknown Source)
      at javafx.scene.Node.impl_processCSS(Unknown Source)
      at javafx.scene.Parent.impl_processCSS(Unknown Source)
      at javafx.scene.control.Control.impl_processCSS(Unknown Source)
      at javafx.scene.Parent.impl_processCSS(Unknown Source)
      at javafx.scene.Node.processCSS(Unknown Source)
      at javafx.scene.Scene.doCSSPass(Unknown Source)
      at javafx.scene.Scene.preferredSize(Unknown Source)
      at javafx.scene.Scene.impl_initPeer(Unknown Source)
      at javafx.stage.Window$13.invalidated(Unknown Source)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(Unknown Source)
      at javafx.beans.property.BooleanPropertyBase.set(Unknown Source)
      at javafx.stage.Window.setShowing(Unknown Source)
      at javafx.stage.Window.show(Unknown Source)
      at javafx.stage.Stage.show(Unknown Source)



      Code:



      import javafx.application.Application;
      import javafx.beans.property.SimpleStringProperty;
      import javafx.scene.Scene;
      import javafx.scene.control.TextArea;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;


      public class TestApp2 extends Application {
          public static void main(String[] args) throws Exception {
              launch(args);
          }

          public void start(final Stage stage) throws Exception {

              VBox root = new VBox();

              TextArea textArea = new TextArea();
              textArea.textProperty().bind(new SimpleStringProperty());

              root.getChildren().add(textArea);

              Scene scene = new Scene(root);
              stage.setScene(scene);
              stage.show();
          }
      }

            leifs Leif Samuelsson (Inactive)
            cschudtjfx Christian Schudt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: