Example usage for javafx.scene.control ScrollPane setPannable

List of usage examples for javafx.scene.control ScrollPane setPannable

Introduction

In this page you can find the example usage for javafx.scene.control ScrollPane setPannable.

Prototype

public final void setPannable(boolean value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 500, 200);
    stage.setScene(scene);/*  w ww .  j  a  v  a  2  s.  c  o  m*/

    Rectangle rect = new Rectangle(200, 200, Color.RED);
    ScrollPane s1 = new ScrollPane();
    s1.setPannable(true);
    s1.setPrefSize(120, 120);
    s1.setContent(rect);

    root.getChildren().add(s1);
    stage.show();
}