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

ChoiceBox with huge number of items renders improperly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P4
    • 8
    • None
    • javafx

    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

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported: