Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8125075

[Slider] Tick label is rendered outside of control boundaries

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8
    • javafx
    • 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);
          }
      }

            psomashe Parvathi Somashekar (Inactive)
            dzinkevi Dmitry Zinkevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: