I am using RichTextFX in my project, but I am having an issue which seems to be contained to Flowless:
I use the following code to append a certain message in bold font:
private InlineCssTextArea text;
//....
//In constructor
text = new InlineCssTextArea();
text.setWrapText(true);
//....
public void appendBold(String msg) {
Platform.runLater(() -> {
int curPos = text.getText().length(); //The index of the first new character
int endPos = msg.length() + curPos - 1; //The index of the last new character
text.appendText(msg);
text.setStyle(curPos, endPos, "-fx-font-weight: bold;");
});
}
(I have two other, similar methods for italic and normal fonts)
This usually works, but sometimes it fails with a StackOverflowError, where the following section of stacktrace repeats continuously:
at org.fxmisc.flowless.VirtualFlow$$Lambda$238/562912964.invalidated(Unknown Source)
at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
at javafx.beans.binding.DoubleBinding.invalidate(DoubleBinding.java:222)
at com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:51)
at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
at javafx.beans.binding.DoubleBinding.invalidate(DoubleBinding.java:222)
at org.fxmisc.flowless.VirtualFlowContent.setLengthOffset(VirtualFlow.java:1426)
at org.fxmisc.flowless.VirtualFlowContent.setLengthPosition(VirtualFlow.java:608)
at org.fxmisc.flowless.VerticalFlowMetrics.setVerticalPosition(VirtualFlow.java:1848)
at org.fxmisc.flowless.VirtualFlow.lambda$new$3(VirtualFlow.java:217)
at org.fxmisc.flowless.VirtualFlow$$Lambda$240/1469374270.changed(Unknown Source)
at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:361)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
at javafx.beans.property.DoublePropertyBase.fireValueChangedEvent(DoublePropertyBase.java:106)
at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:146)
at javafx.scene.control.ScrollBar.setValue(ScrollBar.java:151)
at org.fxmisc.flowless.VirtualFlow.lambda$new$1(VirtualFlow.java:211)
I can not find any common factor between the instances where this error occurs, so I'm not sure if you can help me with this, but I would very much appreciate it if you could have a look.
I am using RichTextFX in my project, but I am having an issue which seems to be contained to Flowless:
I use the following code to append a certain message in bold font:
(I have two other, similar methods for italic and normal fonts) This usually works, but sometimes it fails with a StackOverflowError, where the following section of stacktrace repeats continuously:
I can not find any common factor between the instances where this error occurs, so I'm not sure if you can help me with this, but I would very much appreciate it if you could have a look.