How to synchronize scroll bars on JavaFX?

There are two textareas in my application. I want to synchronize the scrollbars when I move one of them But I can't find a way in JavaFX 2.2

Solution

This works for me:

TextArea ta1 = new TextArea(),ta2 = new TextArea();
ta1.scrollTopproperty().bindBidirectional(ta2.scrollTopproperty());

Generally, you can apply lookupall (string) operation in textarea to find scroll bars in textarea and bind their values in both directions

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>