0

I am looking to define a router in Java which take the Jess's printout content into TextField/TextArea of JavaFx GUI.

A similar question is asked here: Jess printout contents print in Java, but the problem is that I am using JavaFx which import javafx.scene.control.TextArea instead of java.awt.TextArea in Swing.

I've tried to extend the TextAreaWriter class and redefine the constractor to get TextArea object, but the problem still in TextArea's append method.

Community
  • 1
  • 1
FarBen
  • 95
  • 1
  • 8

1 Answers1

0

You'll have to implement a suitable subclass of java.io.Writer. This object may then be used in a call to

rete.addOutputRouter( "t", writerToTextArea );

This is, of course, the same approach as outlined in the link; only you'll have to write a little more Java code yourself.

laune
  • 31,114
  • 3
  • 29
  • 42
  • But, you must convert the content to String type, before you call appentText. – FarBen Apr 23 '16 at 17:07
  • Which method in java.io.Writer inform me that: the router has been appended and you must update your textField. – FarBen Apr 23 '16 at 17:28
  • 1
    Methods implementing append and write in all overloaded forms would have to do that. – laune Apr 23 '16 at 17:41