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

TextArea.setText() fails when it is called with a null parameter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • fx2.0
    • javafx
    • Windows XP Home Edition ServicePack 3, Eclipse IDE 3.7, Java JDK 1.6.26, Java JRE 1.6.26, JavaFX 2.0 build 34 and over

      When I make an TextArea object and I try to set text it works fine when I do something like:

      TextArea myTextArea = new TextArea();
      myTextArea.setText("some text");

      but it fails if I do the following:

      TextArea myTextArea = new TextArea();
      myTextArea.setText(user.getComments());

      where user.getComments() returns a null String value. If user.getComments() returns a non-null String value, it works fine.

      The exception stacktrace is the following:

      java.lang.IllegalArgumentException: value is null.
      at javafx.scene.control.TextInput$TextProperty.set(Unknown Source)
      at javafx.scene.control.TextInput.setText(Unknown Source)
      at javafx.scene.control.TextArea.setText(Unknown Source)
      at gui.UserEdit.setUser(UserEdit.java:619)
      at gui.UserList.modifyRegister(UserList.java:529)
      at gui.UserList.access$7(UserList.java:521)
      at gui.UserList$12.handle(UserList.java:312)
      at gui.UserList$12.handle(UserList.java:1)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
      at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
      at javafx.event.Event.fireEvent(Unknown Source)
      at javafx.scene.Scene$ClickGenerator.postProcess(Unknown Source)
      at javafx.scene.Scene$ClickGenerator.access$5900(Unknown Source)
      at javafx.scene.Scene$MouseHandler.process(Unknown Source)
      at javafx.scene.Scene$MouseHandler.process(Unknown Source)
      at javafx.scene.Scene$MouseHandler.access$1200(Unknown Source)
      at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
      at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
      at com.sun.glass.ui.View.notifyMouse(Unknown Source)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
      at com.sun.glass.ui.win.WinApplication$1$1.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

        1. User.java
          5 kB
        2. UserEdit.java
          24 kB
        3. UserList.java
          20 kB

            leifs Leif Samuelsson (Inactive)
            jmunidojfx Juan Manuel Enrique Muñido (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: