Highlighting strings in JavaFX TextArea


Question

Possible Duplicate:
Highlighting Strings in JavaFX TextArea

how to highlight the text in the textarea? For example in ms-word if we write the text in the find option the same text will highlight in the text area in the same way i wanted to do that in javafx can any one help me?

1
2
5/23/2017 12:22:16 PM

Accepted Answer

Unfortunately rich text is not yet supported (fx 2.2).

You can try next workarounds:

  1. Use RichTextEditor
  2. Use WebView
  3. Draw several Text on Canvas
  4. Just put Text/Labels with different formatting in HBox or TilePane.
  5. Create a transparent pane over the TextArea and draw an opaque highlights, but this can be hard due to complexity of finding out exact words coordinates.
3
9/10/2012 10:23:28 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon