import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ScrollPane; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class ScrollPaneTest extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) { Button button = new Button(); button.setGraphic(new ImageView(new Image("folders.png"))); Button button2 = new Button(); button2.setGraphic(new ImageView(new Image("folders.png"))); HBox hbox = new HBox(button, button2); ScrollPane scrollPane = new ScrollPane(new Group(hbox)); Scene scene = new Scene(scrollPane); stage.setScene(scene); stage.show(); } }