package graphics.api.control.slider; import javafx.beans.*; 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 ShowTickLabelsIssues extends Application { public static void main(String[] args) { ShowTickLabelsIssues.launch(args); } Slider slider = new Slider(); CheckBox ShowTickLabelsChk = new CheckBox(); Scene scene; VBox vbox; @Override public void start(Stage stage) throws Exception { float h = 400; float w = 400; ShowTickLabelsChk.setText("ShowTickLabels"); ShowTickLabelsChk.setSelected(false); slider.setMin(0.0F); slider.setMax(100.0F); slider.setMajorTickUnit(25.0F); slider.setMinorTickCount(0); slider.setShowTickMarks(true); slider.setShowTickLabels(ShowTickLabelsChk.isSelected()); ShowTickLabelsChk.selectedProperty().addListener(new InvalidationListener() { public void invalidated(Observable ov) { slider.setShowTickLabels(ShowTickLabelsChk.isSelected()); vbox.getChildren().clear(); vbox.getChildren().addAll(slider, ShowTickLabelsChk); ((Group) scene.getRoot()).getChildren().clear(); ((Group) scene.getRoot()).getChildren().addAll(vbox); } }); stage.setTitle("ShowTickLabels Test"); scene = new Scene(new Group(), w, h); vbox = new VBox(20.0F); vbox.getChildren().clear(); vbox.getChildren().addAll(slider, ShowTickLabelsChk); vbox.setTranslateX(10.0F); vbox.setTranslateY(h / 4); ((Group) scene.getRoot()).getChildren().clear(); ((Group) scene.getRoot()).getChildren().addAll(vbox); stage.setScene(scene); ShowTickLabelsChk.requestFocus(); stage.show(); } }