JDK-8355774 : RichTextArea: provide mechanism for CSS styling of highlights
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: jfx24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-04-28
  • Updated: 2025-07-22
  • Resolved: 2025-07-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx25 b25Fixed
Related Reports
CSR :  
Relates :  
Description
Goal:
Provide a mechanism for styling of rich text paragraph highlights with CSS [0].

Currently, the highlights can be added via

- RichParagraph.Builder.addHighlight(int start, int end, Color color)
- RichParagraph.Builder.addWavyUnderline(int start, int end, Color color)

There should be methods added that allow for styling the highlights via CSS, something like this:

- RichParagraph.Builder.addHighlight(int start, int end, String ... styles)
- RichParagraph.Builder.addWavyUnderline(int start, int end, String ... styles)

Additionally, we may consider adding other kinds of highlights (double, dotted, dashed), allow for customization beyond the line color, such as wave radius, or even allow for custom highlights.

edit 2025/05/07: clarify which RichParagraph.Builder methods accept the character attributes and styles and which accept the paragraph ones. 

REFERENCES

[0] https://mail.openjdk.org/pipermail/openjfx-dev/2025-April/053906.html
[1] https://www.w3schools.com/cssref/pr_text_text-decoration.php
Comments
Changeset: c9159193 Branch: master Author: Andy Goryachev <angorya@openjdk.org> Date: 2025-07-17 14:41:52 +0000 URL: https://git.openjdk.org/jfx/commit/c915919369efd10662d1c71b7454f33237054dfb
17-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1802 Date: 2025-05-07 22:57:34 +0000
08-05-2025