apps/toys/Hello/src/main/java/hello/HelloTitledPane.java

Print this page
rev 7157 : RT-37173: change selector to match scene-graph of a TitledPane

*** 29,40 **** --- 29,43 ---- import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; + import javafx.scene.control.ScrollPane; import javafx.scene.control.TextField; import javafx.scene.control.TitledPane; + import javafx.scene.image.Image; + import javafx.scene.image.ImageView; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color;
*** 93,105 **** uncollapsible.setText("Not Collapsible"); Button bf = new Button("Button"); bf.setPrefSize(75, 50); uncollapsible.setContent(bf); VBox hbox = new VBox(10); hbox.setPadding(new Insets(20, 0, 0, 20)); ! hbox.getChildren().setAll(normal, gridTitlePane, normalText, unanimated, uncollapsible); Scene scene = new Scene(hbox); scene.setFill(Color.GHOSTWHITE); stage.setScene(scene); stage.show(); --- 96,121 ---- uncollapsible.setText("Not Collapsible"); Button bf = new Button("Button"); bf.setPrefSize(75, 50); uncollapsible.setContent(bf); + // -- Content is a ScrollPane + Image image = new Image("hello/duke.jpg", 200f, 200f, true, true, false); + ImageView imageView = new ImageView(); + imageView.setImage(image); + + ScrollPane scrollPane = new ScrollPane(imageView); + scrollPane.setPannable(true); + + TitledPane scrollableImage = new TitledPane(); + scrollableImage.setPrefHeight(100); + scrollableImage.setText("ScrollPane content"); + scrollableImage.setContent(scrollPane); + VBox hbox = new VBox(10); hbox.setPadding(new Insets(20, 0, 0, 20)); ! hbox.getChildren().setAll(normal, gridTitlePane, normalText, unanimated, uncollapsible, scrollableImage); Scene scene = new Scene(hbox); scene.setFill(Color.GHOSTWHITE); stage.setScene(scene); stage.show();