This is the test code:
public class RichTextFxTest extends Application {
@Override
public void start(Stage stage) throws Exception {
var textArea1 = new InlineCssTextArea();
prepare(textArea1);
var textArea2 = new InlineCssTextArea();
prepare(textArea2);
textArea1.getStylesheets().clear();//LINE X
var box = new VBox(new Label("TextArea1"), textArea1, new Label("TextArea2"), textArea2);
var scene = new Scene(box, 300, 300);
stage.setScene(scene);
stage.show();
}
private void prepare(InlineCssTextArea textArea) {
textArea.appendText("Default style string\n");
textArea.append("Current style string\n",
"-rtfx-underline-color: black;-rtfx-underline-width: 1px;-rtfx-underline-offset: 2px");
}
}
And this is the result:

If LINE X is commented, then the result is:

As you see the line in the first picture is about 2px, while the line in the second one is 1px.
This is the test code:
And this is the result:

If
LINE Xis commented, then the result is:As you see the line in the first picture is about 2px, while the line in the second one is 1px.