Search in sources :

Example 1 with JFXScrollPane

use of com.jfoenix.controls.JFXScrollPane in project JFoenix by jfoenixadmin.

the class ScrollPaneDemo method start.

@Override
public void start(Stage stage) throws Exception {
    JFXListView<Label> list = new JFXListView<Label>();
    for (int i = 0; i < 100; i++) list.getItems().add(new Label("Item " + i));
    list.getStyleClass().add("mylistview");
    list.setMaxHeight(3400);
    StackPane container = new StackPane(list);
    container.setPadding(new Insets(24));
    JFXScrollPane pane = new JFXScrollPane();
    pane.setContent(container);
    JFXButton button = new JFXButton("");
    SVGGlyph arrow = new SVGGlyph(0, "FULLSCREEN", "M402.746 877.254l-320-320c-24.994-24.992-24.994-65.516 0-90.51l320-320c24.994-24.992 65.516-24.992 90.51 0 24.994 24.994 24.994 65.516 0 90.51l-210.746 210.746h613.49c35.346 0 64 28.654 64 64s-28.654 64-64 64h-613.49l210.746 210.746c12.496 12.496 18.744 28.876 18.744 45.254s-6.248 32.758-18.744 45.254c-24.994 24.994-65.516 24.994-90.51 0z", Color.WHITE);
    arrow.setSize(20, 16);
    button.setGraphic(arrow);
    button.setRipplerFill(Color.WHITE);
    pane.getTopBar().getChildren().add(button);
    Label title = new Label("Title");
    pane.getBottomBar().getChildren().add(title);
    title.setStyle("-fx-text-fill:WHITE; -fx-font-size: 40;");
    JFXScrollPane.smoothScrolling((ScrollPane) pane.getChildren().get(0));
    StackPane.setMargin(title, new Insets(0, 0, 0, 80));
    StackPane.setAlignment(title, Pos.CENTER_LEFT);
    StackPane.setAlignment(button, Pos.CENTER_LEFT);
    StackPane.setMargin(button, new Insets(0, 0, 0, 20));
    final Scene scene = new Scene(new StackPane(pane), 600, 600, Color.WHITE);
    stage.setTitle("JFX ListView Demo ");
    stage.setScene(scene);
    stage.show();
}
Also used : JFXScrollPane(com.jfoenix.controls.JFXScrollPane) Insets(javafx.geometry.Insets) SVGGlyph(com.jfoenix.svg.SVGGlyph) JFXListView(com.jfoenix.controls.JFXListView) Label(javafx.scene.control.Label) JFXButton(com.jfoenix.controls.JFXButton) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Aggregations

JFXButton (com.jfoenix.controls.JFXButton)1 JFXListView (com.jfoenix.controls.JFXListView)1 JFXScrollPane (com.jfoenix.controls.JFXScrollPane)1 SVGGlyph (com.jfoenix.svg.SVGGlyph)1 Insets (javafx.geometry.Insets)1 Scene (javafx.scene.Scene)1 Label (javafx.scene.control.Label)1 StackPane (javafx.scene.layout.StackPane)1