comments for jfx.incubator.scene.control.richtext.RichTextArea

Andy Goryachev andy.goryachev at oracle.com
Tue Jun 17 20:46:34 UTC 2025


Dear Alex:

Thank you for trying it out!  Could you share with the purpose of your application or, rather, the function of RichTextArea in your application?


1) Missing method setPromptText similar to method in javafx.scene.control.TextArea:

Good idea.  Created
https://bugs.openjdk.org/browse/JDK-8359862

2) It's not possible to set background color for selection

The selection (I assume you mean selection, not a character attribute https://bugs.openjdk.org/browse/JDK-8356436) can be styled with CSS.  See https://openjfx.io/javadoc/24/javafx.graphics/javafx/scene/doc-files/cssref.html#richtextarea
Selection highlight is implemented in the skin as a Path with style "selection-highlight", like so:

.rich-text-area .selection-highlight {
    -fx-fill: pink;
}


3) It's not possible to set caret position.

Use public final void select(TextPos<TextPos.html> pos)


Hope this helps, and thanks again for trying it out!

Cheers,
-andy



From: openjfx-discuss <openjfx-discuss-retn at openjdk.org> on behalf of Oleksandr Yarmolenko <olexyarm at outlook.com>
Date: Tuesday, June 17, 2025 at 13:21
To: openjfx-discuss at openjdk.org <openjfx-discuss at openjdk.org>
Subject: comments for jfx.incubator.scene.control.richtext.RichTextArea
Hello,
I made a small home project and started to use jfx.incubator.scene.control.richtext.RichTextArea.
It looks OK, but I think a few features are missing in it.
1) Missing method setPromptText similar to method in javafx.scene.control.TextArea:
textArea.setPromptText("Enter Text here.");
2) It's not possible to set background color for selection, but only for whole paragraph.
This is because "background" attribute is missing in "Character Attributes" (https://github.com/andy-goryachev-oracle/Test/blob/main/doc/RichTextArea/RichTextArea_DataFormat.md)
3) It's not possible to set caret position. The richTextArea.caretPositionProperty() has method getValueI(), but does not have method setValue().
Please, let me know if I'm missing something.
Thanks,
Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-discuss/attachments/20250617/48a0acee/attachment-0001.htm>


More information about the openjfx-discuss mailing list