package graphics.api.control.slider; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.control.Slider; import javafx.scene.control.CheckBox; import javafx.scene.layout.*; public class SnapToTicksIssue extends Application { public static void main(String[] args) { SnapToTicksIssue.launch(args); } CheckBox SnapToTicksChk = new CheckBox(); Slider slider = new Slider(); @Override public void start(Stage stage) throws Exception { float h = 400; float w = 400; SnapToTicksChk.setText("SnapToTicks"); SnapToTicksChk.setSelected(false); slider.setMin(0.0F); slider.setMax(100.0F); slider.setShowTickMarks(true); slider.setShowTickLabels(false); slider.snapToTicksProperty().bind(SnapToTicksChk.selectedProperty()); stage.setTitle("SnapToTicks Test"); Scene scene = new Scene(new Group(), w, h); VBox vbox = new VBox(20.0F); vbox.setTranslateX(10.0F); vbox.setTranslateY(h / 4); vbox.getChildren().clear(); vbox.getChildren().addAll(slider, SnapToTicksChk); ((Group) scene.getRoot()).getChildren().clear(); ((Group) scene.getRoot()).getChildren().addAll(vbox); stage.setScene(scene); stage.setVisible(true); } }