Re: Streaming short pieces of text into a textarea causes a crash

2023-12-19 Thread John Hendrikx
FX doesn't always warn you (as it would mean putting thread checks everywhere). The first trace however shows that the change to the TextArea did not originate from the FX thread. --John On 19/12/2023 18:17, Frank Delporte wrote: Thanks John, quick test with this change indeed seems to solve

Re: Streaming short pieces of text into a textarea causes a crash

2023-12-19 Thread Frank Delporte
Thanks John, quick test with this change indeed seems to solve the problem! Platform.runLater(() -> searchAction.appendAnswer(token)); I totally missed this and I didn't notice anything in the logs that was pointing in this direction. Best regards Frank Delporte Want to have coding-fun?

Re: Streaming short pieces of text into a textarea causes a crash

2023-12-19 Thread John Hendrikx
It looks like you are manipulating a property that is bound to a UI control on an external thread. Property manipulations that are tied to controls that are part of an active (visible) Scene **must** be done on the FX thread. Try:     StreamingResponseHandler streamingResponseHandler = new

Streaming short pieces of text into a textarea causes a crash

2023-12-19 Thread Frank Delporte
Hi, while experimenting with a ChatGPT-like user interface, I found a crashing JVM with different types of errors when streaming the response towards a TextArea. This is probably caused by too fast refreshes of the text as pieces of content are received within the same milliseconds: 19/12/202