You can see it on the attached movie.
Code:
@Override
public void start(Stage stage) throws Exception {
VBox vb = new VBox();
Tooltip tp = new Tooltip();
tp.setText("text");
tp.setGraphic(new Rectangle(0, 0, 10, 10));
Button b = new Button("with tooltip");
b.setTooltip(tp);
Slider slider1 = new Slider(0, 100, 50);
slider1.setShowTickLabels(true);
slider1.setShowTickMarks(true);
slider1.valueProperty().bindBidirectional(tp.graphicTextGapProperty());
vb.getChildren().addAll(b, new Label("Graphic text gap"), slider1);
Scene scene = new Scene(vb, 300, 300);
stage.setScene(scene);
stage.show();
}
Code:
@Override
public void start(Stage stage) throws Exception {
VBox vb = new VBox();
Tooltip tp = new Tooltip();
tp.setText("text");
tp.setGraphic(new Rectangle(0, 0, 10, 10));
Button b = new Button("with tooltip");
b.setTooltip(tp);
Slider slider1 = new Slider(0, 100, 50);
slider1.setShowTickLabels(true);
slider1.setShowTickMarks(true);
slider1.valueProperty().bindBidirectional(tp.graphicTextGapProperty());
vb.getChildren().addAll(b, new Label("Graphic text gap"), slider1);
Scene scene = new Scene(vb, 300, 300);
stage.setScene(scene);
stage.show();
}