2

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?

Community
  • 1
  • 1
duke
  • 103
  • 6
  • 15

1 Answers1

3

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.
Sergey Grinev
  • 34,078
  • 10
  • 128
  • 141