How to bind vertical scroll in multi tableview

Hi javafx folks,

Today I will show how to make your multi table view bind with a single ScrollBar. JavaFX is becoming more and more powerful and nowadays people are using this javafx for comaparing the data between tables and it’s pretty much helpful for scrolling the tables with a single Scrollbar.

To make this things happen ; Firstly I have dived to check if there is any api for making scroll binding in both tables but I didn’t find them. I then went to see if there is any manual scroll of the tableview finally i found them scrollTo(int) which is really helpful for the programmer to scroll the tableview manually.

Lets first see how we are going to make this happen.

Table Vertical Scrolling Binding


As you can see in the above picture I’ve stated how to make two tableview vertical Scroll bind with a single External ScrollBar.

Firstly You need to hide your vertical scrollbar.  Please add styleclass “mytableview” for both of the table view to make this css to take effect.


Hiding Vertical Scrollbar of TableView from CSS

As I’ve already stated here i’ve used “mytableview” class which is the TableView class.

Now Just create Two TableView and one ScrollBar Let’s suppose “table1”, “table2” and “scroller”.
Let’s see how it works

Scroll TableView with ScrollBar value

Now you have sucessfully made multi-tableview scroll from a single ScrollBar.

Only this much for today.
Have a 🙂 good day. Keep on coding with technique.



7 thoughts on “How to bind vertical scroll in multi tableview”

  1. I’m getting this trying to see the demo:

    JRE 1.7.0_09-b05 Java HotSpot(TM) 64-Bit Server VM access denied (“java.lang.RuntimePermission” “accessDeclaredMembers”)
    at java.lang.SecurityManager.checkPermission(
    at java.lang.SecurityManager.checkMemberAccess(
    at java.lang.Class.checkMemberAccess(
    at java.lang.Class.getDeclaredFields(
    at javafx.fxml.FXMLLoader.getControllerFields(
    at javafx.fxml.FXMLLoader.access$1400(
    at javafx.fxml.FXMLLoader$ValueElement.processValue(
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(
    at javafx.fxml.FXMLLoader.processStartElement(
    at javafx.fxml.FXMLLoader.load(
    at javafx.fxml.FXMLLoader.load(
    at javafx.fxml.FXMLLoader.load(
    at javafx.fxml.FXMLLoader.load(
    at javafx.fxml.FXMLLoader.load(
    at javafx.fxml.FXMLLoader.load(
    at javafx.fxml.FXMLLoader.load(
    at javafxapplication2.JavaFXApplication2.start(

  2. pozycjonowanie stron lublin

    Everyone loves what you guys are up too. This type
    of clever work and exposure! Keep up the amazing works guys
    I’ve incorporated you guys to our blogroll.

  3. Thanks …
    But i have some question .
    is There a way to access the rows viewed in current view of table view
    with out using scroll to method
    i need to get number of row that is showing .

Leave a Reply