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

Right most Slider Axis label sometimes invisible

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Linux:
      Linux 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
      openjdk version "11.0.8" 2020-07-14 LTS
      OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS)
      OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)

      Windows:
      Windows 10, Version 20H2 (Build 19042.985)
      openjdk 15.0.1 2020-10-20
      OpenJDK Runtime Environment (build 15.0.1+9-18)
      OpenJDK 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      We are encountering the behavior described under JDK-8097004 under Linux and Windows: The right most (maximum) tick label of a Slider is not visible even though it should be.
      Screenshot: <attached Screen shot>

      I have attached an updated sample code that always reproduces the behavior for us under Windows and Linux (the original sample code did not reproduce the bug for us).

      Apparently, the bug had been fixed in April 2014. However, in January 2015, the fix was removed as part of JDK-8097482. The submitter of the fix for stated "The rounding seems unnecessary, RT-36766 (= JDK-8097482), which is related to this, is not affected by this change because the result of getDisplayPosition is still rounded in the Axis.layoutChildren. ": https://bugs.openjdk.java.net/browse/JDK-8097482?focusedCommentId=13806129&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-13806129
      However, I do not see any rounding being applied to the result of getDisplayPosition in the Axis.layoutChildren (maybe that code has also changed since the fix), and the original bug seems to have resurfaced.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Same as in original bug report, with updated sample. The window width values I can reproduce the problem with are specified in the updated sample.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The maximum value label should be visible.
      ACTUAL -
      The maximum value label is not visible.

      ---------- BEGIN SOURCE ----------

      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.Slider;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class SliderTest extends Application {

      @Override
      public void start(final Stage primaryStage) throws Exception {

      final int sliderMax = 1200000;
      final Slider slider = new Slider();
      slider.setPadding(new Insets(12));
      slider.setShowTickLabels(true);
      slider.setShowTickMarks(true);
      slider.setMax(sliderMax);
      slider.setMajorTickUnit(sliderMax / 4);

      primaryStage.centerOnScreen();
      primaryStage.setHeight(150);

      final double problematicOnLinux = 430;
      final double problematicOnWindows = 436;
      primaryStage.setWidth(problematicOnLinux);

      primaryStage.setScene(new Scene(new StackPane(slider)));

      primaryStage.show();

      }

      public static void main(String[] args) throws Exception {
      launch(args);
      }

      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        1. Capture1.PNG
          22 kB
          Praveen Narayanaswamy
        2. SliderTest.java
          0.9 kB
          Praveen Narayanaswamy

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: