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

[ComboBox] IndexOutOfBoundsException when onAction handler changes the selection.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9
    • javafx
    • None
    • generic
    • generic

      This is the code to reproduce (snippet from the attached file):

          ComboBox<Integer> combo = new ComboBox<>(FXCollections.observableArrayList(1, 2, 3));
          combo.setOnAction(ae -> combo.getSelectionModel().clearSelection());

      Run the attached program and select any item from the ComboBox. IndexOutOfBoundsException will occur.

      One can as well change `clearSelection()` in the above code to `select(0)` and then select any item except the first one to reproduce the error.

            Unassigned Unassigned
            tmikula Tomas Mikula
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: