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

ChoiceBox with huge number of items renders improperly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Description

      If you run the test case below, at least on a Mac, when scrolling up and down the choicebox you will sometimes get large empty areas at the top and bottom as shown in the attached screen shot. The error occurs when the scrolling arrives at the very top of the choice box list - instead of only showing the first element, empty space is shown above it. Similarly when arriving at the bottom of the list - instead of only showing the last element, empty space is shown below the last element. For some reason the empty area is larger at the top than at the bottom.


      public class ChoiceBoxBug extends Application {

      private ChoiceBox choiceBox = new ChoiceBox();

      @Override
      public void start(Stage stage) throws Exception {

      BorderPane borderPane = new BorderPane();
      borderPane.setTop(choiceBox);
      List<String> longList = new ArrayList();
      for(int i = 0; i < 100; i++) {
      longList.add("Item number " + i);
      }
      choiceBox.getItems().setAll(longList);
      stage.setWidth(300);
      stage.setScene(new Scene(borderPane));
      stage.show();
      }

      public static void main(String[] args) {
      Application.launch(args);
      }
      }

        Attachments

          Activity

            People

            Assignee:
            psomashe Parvathi Somashekar (Inactive)
            Reporter:
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved:
              Imported: