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

Exception in thread "Thread-4" - new line in TextArea

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P4 P4
    • fx2.0
    • fx2.0
    • javafx
    • Eclipse Indigo, Windows 7, JavaFX 2.0, JAVA 7 SE build 1.6.0_26-b03

      Trying to refresh TextArea in thread with "\n" drops error. Over run() method it works fine.

      Exception in thread "Thread-4" java.lang.IllegalStateException: Not on FX application thread; currentThread = Thread-4
      at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:190)
      at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:336)
      at javafx.scene.Parent$2.onProposedChange(Parent.java:270)
      at com.sun.javafx.collections.VetoableObservableList.add(VetoableObservableList.java:143)
      at com.sun.javafx.scene.control.skin.TextAreaSkin$12.onChanged(TextAreaSkin.java:417)
      at com.javafx.preview.control.TextArea.fireParagraphListChangeEvent(TextArea.java:392)
      at com.javafx.preview.control.TextArea.access$200(TextArea.java:24)
      at com.javafx.preview.control.TextArea$TextAreaContent.insert(TextArea.java:138)
      at com.javafx.preview.control.TextInput$TextProperty.store(TextInput.java:102)
      at com.javafx.preview.control.TextInput$TextProperty.set(TextInput.java:87)
      at com.javafx.preview.control.TextInput.setText(TextInput.java:187)
      at com.javafx.preview.control.TextArea.setText(TextArea.java:367)
      at hostPing.run(hostPing.java:205)
      at java.lang.Thread.run(Unknown Source)

      Sample code:
      @Override
      public void run() {
      while (isStart) {
      try {
      p.openPort();
      responseBox.setText(p.response+"\n");
      } catch (InterruptedException e) {
      // TODO Auto-generated catch block

      }

      Without "\n" ok.

            leifs Leif Samuelsson (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: