1

I'm using RichTextFX for a project, and want to add a Canvas to the background of the CodeArea in RichTextFX. I've done so, but I haven't been able to find a way to make it scroll with the CodeArea itself.

Is there a way to get the scroll position of the CodeArea programmatically so I can do this?

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
Salman Arif
  • 105
  • 5

1 Answers1

0

While I haven't found good way of scrolling in percentage, the following is my current workaround, which works, if the scroll position correlates to some character position in the text:

int index = codeArea.getText().indexOf(textToFind);
codeArea.moveTo(index);
codeArea.selectRange(index, index);
dumbPotato21
  • 5,669
  • 5
  • 21
  • 34
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222