How to scroll in ScrollPane with mouse?

javafx

Solution

Just call

scrollPane.setPannable(true);

or, if you are using FXML

<ScrollPane pannable="true" ... >

Problem

Is it possible to move vertically and horizontally without using scrollbar in `ScrollPane` i want to scroll when left mouse button pressed and mouse moved to right, left, top and down . Should i add listener or something like that ? thanks in advance.

Original source