Run attached code.
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.OverrunStyle;
import javafx.scene.control.Slider;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaApplication42 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(final Stage stage) throws Exception {
Button button = new Button("One two three four five");
button.setTextOverrun(OverrunStyle.CLIP);
Slider slider = new Slider();
slider.setShowTickLabels(true);
slider.setShowTickMarks(true);
slider.valueProperty().bindBidirectional(button.prefWidthProperty());
Group group = new Group();
Scene scene = new Scene(group, 300, 300);
VBox vbox = new VBox(5.0);
vbox.getChildren().clear();
vbox.getChildren().addAll(button, slider);
group.getChildren().clear();
group.getChildren().addAll(vbox);
stage.setScene(scene);
stage.show();
}
}
You can see here:
http://aurora-ds.ru.oracle.com:9500/runs/70276.ManualSubmit-1/workDir/javafx/scene/control/test/labeled/ToggleButtonsTest_setTextOverrunSingleLineTest/ToggleButtonsTest-setTextOverrunSingleLine.png
That clip make the same effect, as ellipsis. That makes diff:
http://aurora-ds.ru.oracle.com:9500/runs/70276.ManualSubmit-1/workDir/javafx/scene/control/test/labeled/ToggleButtonsTest_setTextOverrunSingleLineTest/ToggleButtonsTest-setTextOverrunSingleLine-diff.png
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.OverrunStyle;
import javafx.scene.control.Slider;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaApplication42 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(final Stage stage) throws Exception {
Button button = new Button("One two three four five");
button.setTextOverrun(OverrunStyle.CLIP);
Slider slider = new Slider();
slider.setShowTickLabels(true);
slider.setShowTickMarks(true);
slider.valueProperty().bindBidirectional(button.prefWidthProperty());
Group group = new Group();
Scene scene = new Scene(group, 300, 300);
VBox vbox = new VBox(5.0);
vbox.getChildren().clear();
vbox.getChildren().addAll(button, slider);
group.getChildren().clear();
group.getChildren().addAll(vbox);
stage.setScene(scene);
stage.show();
}
}
You can see here:
http://aurora-ds.ru.oracle.com:9500/runs/70276.ManualSubmit-1/workDir/javafx/scene/control/test/labeled/ToggleButtonsTest_setTextOverrunSingleLineTest/ToggleButtonsTest-setTextOverrunSingleLine.png
That clip make the same effect, as ellipsis. That makes diff:
http://aurora-ds.ru.oracle.com:9500/runs/70276.ManualSubmit-1/workDir/javafx/scene/control/test/labeled/ToggleButtonsTest_setTextOverrunSingleLineTest/ToggleButtonsTest-setTextOverrunSingleLine-diff.png