-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8
-
jdk1.8.0_b64
If you run the app, you will see that last zero of label "5000" is rendered outside of control bounds.
import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Slider;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class TestSlider extends Application {
int SLOT_WIDTH = 150;
int SLOT_HEIGHT = 150;
@Override
public void start(Stage primaryStage) {
Slider slider = new Slider(0, 5000, 1000);
slider.setShowTickMarks(true);
slider.setShowTickLabels(true);
slider.setMajorTickUnit(1250);
slider.setMinorTickCount(5);
slider.setStyle("-fx-border-color: red");
slider.setOrientation(Orientation.HORIZONTAL);
slider.setPrefSize(SLOT_WIDTH, SLOT_HEIGHT);
slider.setMaxSize(SLOT_WIDTH, SLOT_HEIGHT);
slider.setMinSize(SLOT_WIDTH, SLOT_HEIGHT);
HBox root = new HBox(20d);
root.getChildren().add(slider);
Scene scene = new Scene(root, 600, 400);
primaryStage.setScene(scene);
primaryStage.setTitle(System.getProperty("java.runtime.version") + "; " + System.getProperty("javafx.runtime.version"));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Slider;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class TestSlider extends Application {
int SLOT_WIDTH = 150;
int SLOT_HEIGHT = 150;
@Override
public void start(Stage primaryStage) {
Slider slider = new Slider(0, 5000, 1000);
slider.setShowTickMarks(true);
slider.setShowTickLabels(true);
slider.setMajorTickUnit(1250);
slider.setMinorTickCount(5);
slider.setStyle("-fx-border-color: red");
slider.setOrientation(Orientation.HORIZONTAL);
slider.setPrefSize(SLOT_WIDTH, SLOT_HEIGHT);
slider.setMaxSize(SLOT_WIDTH, SLOT_HEIGHT);
slider.setMinSize(SLOT_WIDTH, SLOT_HEIGHT);
HBox root = new HBox(20d);
root.getChildren().add(slider);
Scene scene = new Scene(root, 600, 400);
primaryStage.setScene(scene);
primaryStage.setTitle(System.getProperty("java.runtime.version") + "; " + System.getProperty("javafx.runtime.version"));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}