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

ComboBox has irregular behavior with respect to scroll bars

XMLWordPrintable

    • x86
    • windows_8

      FULL PRODUCT VERSION :
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]
      otherwise known as Windows 8.1 Professional

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Code developed in NetBeans 8.0.2

      A DESCRIPTION OF THE PROBLEM :
      JavaFX combo box initialized as follows (with an enum class Category):
          dropDown.setPromptText(Category.class.getSimpleName());
          dropDown.setVisibleRowCount(Category.values().length);
          dropDownData.addAll(Arrays.asList(Category.values()));
          dropDown.setItems(dropDownData);

      When the combobox first displays the list, it has an (unnecessary) vertical scroll bar. If the first item is selected twice, or any other item once, on subsequent use, the scroll bars are (correctly) not there. There is something wrong in the set up of the initial state that gets corrected as the combobox is used.


      ADDITIONAL REGRESSION INFORMATION:
      Do not know if this was working previously. It is not working on the Java and JDK version listed above.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Use the code given above with any enum class to provide entries.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected that there were enough item positions that scroll bars would not be needed. In fact, the combobox eventually works that out, but not initially.
      ACTUAL -
      Saw scroll bars initially (that are not needed), and that they did correctly not display after usage of the combobox.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No error message.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      No known workaround, although online some suggest using CSS to hide the scroll bars. See https://community.oracle.com/thread/3539733 for another description of this problem, and somebody's suggested solution.

            jgiles Jonathan Giles
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: