Search in sources :

Example 1 with JFXSlider

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

the class SliderDemo method start.

@Override
public void start(Stage stage) {
    JFXSlider horLeftSlider = new JFXSlider();
    horLeftSlider.setMinWidth(500);
    JFXSlider horRightSlider = new JFXSlider();
    horRightSlider.setMinWidth(500);
    horRightSlider.setIndicatorPosition(IndicatorPosition.RIGHT);
    JFXSlider verLeftSlider = new JFXSlider();
    verLeftSlider.setMinHeight(500);
    verLeftSlider.setOrientation(Orientation.VERTICAL);
    JFXSlider verRightSlider = new JFXSlider();
    verRightSlider.setMinHeight(500);
    verRightSlider.setOrientation(Orientation.VERTICAL);
    verRightSlider.setIndicatorPosition(IndicatorPosition.RIGHT);
    HBox hbox = new HBox();
    hbox.setSpacing(450);
    hbox.getChildren().addAll(verRightSlider, verLeftSlider);
    VBox vbox = new VBox();
    vbox.getChildren().addAll(horRightSlider, horLeftSlider, hbox);
    vbox.setSpacing(100);
    vbox.setPadding(new Insets(100, 50, 50, 150));
    Scene scene = new Scene(new Group());
    ((Group) scene.getRoot()).getChildren().add(vbox);
    scene.getStylesheets().add(SliderDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
    stage.setScene(scene);
    stage.setWidth(900);
    stage.setHeight(900);
    stage.show();
    stage.setTitle("JFX Slider Demo");
}
Also used : Group(javafx.scene.Group) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) JFXSlider(com.jfoenix.controls.JFXSlider) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox)

Aggregations

JFXSlider (com.jfoenix.controls.JFXSlider)1 Insets (javafx.geometry.Insets)1 Group (javafx.scene.Group)1 Scene (javafx.scene.Scene)1 HBox (javafx.scene.layout.HBox)1 VBox (javafx.scene.layout.VBox)1