How to sync scrollbars in JavaFX?
1 answer
This worked for me:
TextArea ta1 = new TextArea(), ta2 = new TextArea();
ta1.scrollTopProperty().bindBidirectional(ta2.scrollTopProperty());
In general, you can apply the lookupAll (String) operation on a TextArea to find the scrollbar inside the TextArea and bind their values bi-directionally.
+7
source to share